Skip to main content
Vulnerability Database/CVE-2026-57487

CVE-2026-57487: pupnp SDK Chunked Encoding DoS Vulnerability

CVE-2026-57487 is a denial of service vulnerability in pupnp SDK that allows remote attackers to cause resource exhaustion through chunked encoding bypass. This article covers technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-57487 Overview

CVE-2026-57487 is a resource exhaustion vulnerability [CWE-770] in pupnp, an SDK used to build Universal Plug and Play (UPnP) device and control point applications. Versions prior to 2.0.2 fail to enforce the g_maxContentLength limit on HTTP bodies that use Transfer-Encoding: chunked. A remote peer that can reach a Simple Object Access Protocol (SOAP), General Event Notification Architecture (GENA), miniserver, or control-point HTTP response path can send a chunked body larger than the configured maximum. The process buffers the decoded entity in memory, leading to resource exhaustion and denial of service. The issue is fixed in release 2.0.2.

Critical Impact

Unauthenticated remote attackers can exhaust memory on any process linking vulnerable pupnp versions, taking UPnP services and dependent devices offline.

Affected Products

  • pupnp (libupnp) versions prior to 2.0.2
  • UPnP devices and control points built on pupnp SOAP, GENA, or miniserver paths
  • Embedded firmware and IoT products shipping bundled pupnp libraries

Discovery Timeline

  • 2026-10-16 - CVE-2026-57487 published to the National Vulnerability Database
  • 2026-10-21 - Last updated in NVD database

Technical Details for CVE-2026-57487

Vulnerability Analysis

The flaw resides in the HTTP parser located in upnp/src/genlib/net/http/httpparser.c. When a peer sends an HTTP message with Transfer-Encoding: chunked, the functions parser_parse_chunky_entity and parser_parse_chunky_body accumulate decoded bytes in parser->msg.entity while leaving parser->content_length at zero. In http_RecvMessage within upnp/src/genlib/net/http/httpreadwrite.c, the enforcement check compared only parser->content_length against g_maxContentLength. Because the chunked path never populates content_length, the check always passes and the parser continues appending decoded bytes to an in-memory buffer with no upper bound.

Root Cause

The root cause is missing resource limit enforcement on an alternate input path. The g_maxContentLength guard was written for messages that advertise a numeric Content-Length header. The chunked-encoding branch was never routed through the same check, resulting in missing size validation for decoded entity data in parser->msg.entity.length.

Attack Vector

An unauthenticated remote attacker reachable to any pupnp HTTP endpoint — SOAP action handlers, GENA event callbacks, the miniserver, or a control-point response reader — sends a request or response using Transfer-Encoding: chunked. The attacker streams arbitrarily large chunked data. The process grows parser->msg.entity until memory is exhausted, triggering an out-of-memory kill or rendering the host unresponsive.

c
// Patch from upnp/src/genlib/net/http/httpreadwrite.c
// Enforce g_maxContentLength on chunked entity bodies (GHSA-gcj7-j9f7-q84c)
					parser->msg.msg.buf);
 				print_http_headers(&parser->msg);
 				if (g_maxContentLength > 0 &&
-					parser->content_length >
-						(unsigned int)
-							g_maxContentLength) {
+					(parser->content_length >
+							(unsigned int)
+								g_maxContentLength ||
+						parser->msg.entity.length >
+							g_maxContentLength)) {
 					*http_error_code =
 						HTTP_REQ_ENTITY_TOO_LARGE;
 					line = __LINE__;

Source: pupnp commit 9ff9bc583ad8

Detection Methods for CVE-2026-57487

Indicators of Compromise

  • Inbound HTTP requests to UPnP endpoints (typically TCP ports 1900, 49152+, or vendor-specific) containing the Transfer-Encoding: chunked header.
  • Sustained memory growth or out-of-memory terminations in processes linking libupnp.
  • Repeated SOAP, GENA, or miniserver connections from a single remote peer that never cleanly terminate.

Detection Strategies

  • Inspect HTTP traffic to UPnP services for chunked transfer encoding and flag chunk streams exceeding the device's configured g_maxContentLength.
  • Correlate process memory pressure alerts with network sessions targeting UPnP ports to attribute exhaustion events.
  • Fingerprint the running libupnp version on managed hosts and alert when versions older than 2.0.2 are present.

Monitoring Recommendations

  • Monitor resident set size (RSS) of UPnP-enabled daemons and alert on sudden growth above baseline.
  • Log and rate-limit inbound connections to UPnP control points from untrusted networks.
  • Track egress responses parsed by pupnp control points for abnormally large chunked bodies originating from untrusted servers.

How to Mitigate CVE-2026-57487

Immediate Actions Required

  • Upgrade pupnp to release 2.0.2 or later on all affected hosts and firmware images.
  • Identify embedded or third-party products that ship bundled libupnp and request updated builds from vendors.
  • Restrict UPnP service exposure to trusted network segments and block UPnP ports at the perimeter.

Patch Information

The fix is included in pupnp release 2.0.2 and documented in GitHub Security Advisory GHSA-gcj7-j9f7-q84c. The patch extends the http_RecvMessage check to compare both parser->content_length and parser->msg.entity.length against g_maxContentLength, returning HTTP_REQ_ENTITY_TOO_LARGE when either exceeds the limit.

Workarounds

  • Place UPnP services behind a reverse proxy or firewall that enforces a strict maximum request body size.
  • Disable UPnP on devices and hosts where it is not required for operation.
  • Where feasible, drop inbound HTTP requests containing Transfer-Encoding: chunked destined for UPnP endpoints until the patch is deployed.
bash
# Example: block chunked transfer-encoding to a UPnP miniserver port using iptables
iptables -A INPUT -p tcp --dport 49152 \
  -m string --algo bm --string "Transfer-Encoding: chunked" \
  -j DROP

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.