Summary
CVE-2026-103432 is a stack-based buffer overflow (CWE-121) in the getupsvar() function used by apcupsd’s CGI modules, affecting apcupsd through version 3.14.14. An unbounded sscanf() call copies attacker-influenced data from a Network Information Server (NIS) response into a fixed-size stack buffer without a width limit, and in some cases the same function can return success while leaving the destination buffer uninitialized. The issue is rated HIGH severity (CVSS 8.1) and is remotely exploitable with no authentication or user interaction.
Technical details
- Root cause:
getupsvar()insrc/cgi/upsfetch.cusessscanf()without a field width limit when parsing data returned by a UPS NIS server, allowing it to write beyond fixed-size (e.g. 256-byte) caller buffers. - A related code path in the same function can leave the destination buffer uninitialized while still signaling success, leaking stack memory into the HTTP response.
- Trigger conditions: the vulnerable CGI binaries (
upsstats.cgi,multimon.cgi,upsfstats.cgi) must be reachable via a web server, and the attacker controls or can spoof a UPS host that the CGI queries over the NIS protocol — this includes the default case wherehosts.confis absent/empty and all hosts are implicitly trusted. - Attack vector: network, no privileges or user interaction required; the attacker interacts with the CGI over HTTP, which in turn queries an attacker-controlled or spoofed NIS host.
- Impact: denial of service (CGI process crash), disclosure of uninitialized stack memory in HTTP responses, and overflow primitives that could enable remote code execution, though full RCE has not been publicly demonstrated.
- This issue is noted as related to CVE-2026-15544. The equivalent daemon-side code in
src/drivers/net/net.cwas previously hardened with width-limited format strings and loop bounds; that fix has not been applied to the CGI code path.
Affected software
- apcupsd (apcupsd-cgi component): all versions through 3.14.14, including the CGI binaries
upsstats.cgi,multimon.cgi, andupsfstats.cgi.
Severity
- CVSS v3.1 Base Score: 8.1 (High)
- Vector:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: No official upstream patch is available — apcupsd has not published a release since 2016. Apply the equivalent width-limited
sscanf()fix from the daemon’ssrc/drivers/net/net.ctosrc/cgi/upsfetch.cand rebuild, or obtain a distribution/vendor-backported package if one is issued. - If no patch can be applied: disable or remove the affected CGI binaries (
upsstats.cgi,multimon.cgi,upsfstats.cgi) from the web server, or restrict access to them (authentication, IP allow-listing, or placing them behind a VPN). - Configure
hosts.confwith an explicit, restrictive list of trusted UPS/NIS hosts rather than relying on the default allow-all behavior. - Restrict network exposure of the web server hosting the apcupsd CGI interface so it is not reachable from untrusted networks or the public internet.

