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-57488 Overview
CVE-2026-57488 is an integer truncation vulnerability [CWE-190] in pupnp, a widely deployed SDK for building Universal Plug and Play (UPnP) device and control point applications. The flaw resides in the raw_to_int function in upnp/src/genlib/net/http/httpparser.c, which parses HTTP Content-Length headers. On LP64 systems, oversized values can wrap or truncate when a long is cast to a 32-bit int, leading to parser disagreement about the actual body length. Versions prior to 2.0.2 are affected.
Critical Impact
An adjacent-network attacker can trigger HTTP request smuggling in persistent or proxied connections, or force a worker to wait on an oversized body to achieve denial of service.
Affected Products
- pupnp versions prior to 2.0.2
- Applications and embedded devices linking the pupnp SDK for UPnP functionality
- LP64 systems where sizeof(long) > sizeof(int) (most 64-bit Linux and Unix platforms)
Discovery Timeline
- 2026-10-16 - CVE-2026-57488 published to NVD
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-57488
Vulnerability Analysis
The raw_to_int helper in pupnp's HTTP parser converts a header value string to an integer using strtol. The result is stored in a long, validated, and then cast to a 32-bit int before being returned to the caller, which stores it in an unsigned int body-length field.
On LP64 platforms, long is 64 bits while int is 32 bits. Any Content-Length value above INT_MAX passes the pre-cast validation but is silently truncated or wraps when converted. The parser then operates on a body length that differs from what the sender declared, breaking the HTTP framing contract.
This parser disagreement is the root condition for HTTP Request Smuggling in persistent (keep-alive) or proxied connections, where leftover bytes from one request can be interpreted as the start of another. Alternatively, a crafted value can cause the parser to accept a body length far larger than intended, blocking a worker thread and exhausting server capacity.
Root Cause
The fix confirms the root cause: raw_to_int used strtol and performed an unchecked downcast to int. The range check only guarded against negatives and LONG_MIN/LONG_MAX, so any value between INT_MAX + 1 and LONG_MAX was accepted and then truncated.
Attack Vector
Exploitation requires network adjacency to a host running a vulnerable pupnp-based service, typically a UPnP endpoint reachable on the local segment. The attacker sends an HTTP request with a Content-Length header value crafted to exceed INT_MAX, producing a mismatch between the declared and parsed body length. In proxied or persistent-connection setups, this enables request smuggling; in standalone deployments it supports denial of service by stalling worker threads.
// Security patch in upnp/src/genlib/net/http/httpparser.c
// fix: prevent integer truncation in raw_to_int (GHSA-g6c2-x4r9-352g)
int raw_to_int(memptr *raw_value, int base)
{
- long num;
+ long long num;
char *end_ptr;
if (raw_value->length == (size_t)0)
return -1;
errno = 0;
- num = strtol(raw_value->buf, &end_ptr, base);
- if ((num < 0)
+ num = strtoll(raw_value->buf, &end_ptr, base);
+ if ((num < 0) ||
+ (num > INT_MAX)
/* all and only those chars in token should be used for num */
|| (end_ptr != raw_value->buf + raw_value->length) ||
- ((num == LONG_MIN || num == LONG_MAX) && (errno == ERANGE))) {
+ ((num == LLONG_MAX) && (errno == ERANGE))) {
return -1;
}
return (int)num;
Source: pupnp commit de9602a. The patch switches to strtoll with a long long accumulator and explicitly rejects any value greater than INT_MAX before the final cast.
Detection Methods for CVE-2026-57488
Indicators of Compromise
- HTTP requests to UPnP services (typically ports 1900, 2869, or vendor-specific) carrying Content-Length values greater than 2147483647.
- Keep-alive connections where response boundaries appear misaligned with the next request on the same socket.
- UPnP worker threads blocked for extended periods awaiting a request body that never arrives.
Detection Strategies
- Inventory binaries and firmware images that statically or dynamically link libupnp and compare the embedded version against 2.0.2.
- Deploy IDS/WAF signatures that flag HTTP requests with Content-Length headers exceeding INT_MAX or containing non-numeric framing anomalies.
- Instrument reverse proxies in front of UPnP services to log and reject requests where downstream and upstream body-length interpretations diverge.
Monitoring Recommendations
- Alert on sudden spikes in long-lived or stalled TCP connections to UPnP listening ports.
- Monitor process metrics on embedded devices for pupnp worker thread exhaustion or memory pressure.
- Capture packet samples at egress boundaries to identify adjacent-network scanning of UPnP endpoints.
How to Mitigate CVE-2026-57488
Immediate Actions Required
- Upgrade pupnp to version 2.0.2 or later across all servers, appliances, and embedded firmware.
- For vendor-supplied devices without an available update, restrict UPnP service exposure to trusted network segments only.
- Place vulnerable pupnp services behind an HTTP reverse proxy that normalizes and validates Content-Length headers.
Patch Information
The vulnerability is fixed in pupnp 2.0.2. See the GitHub Security Advisory GHSA-g6c2-x4r9-352g and the pupnp 2.0.2 release notes for the authoritative patch and backport guidance.
Workarounds
- Block or filter inbound UPnP traffic at the network perimeter and on segmentation boundaries where UPnP is not required.
- Configure fronting proxies to reject requests with Content-Length values that exceed a conservative maximum (for example, 100 MB) and to normalize framing.
- Disable UPnP services on devices where the functionality is not actively used.
# Example iptables rule restricting UPnP (SSDP/HTTP) to a trusted management subnet
iptables -A INPUT -p tcp --dport 2869 -s 10.0.100.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 2869 -j DROP
iptables -A INPUT -p udp --dport 1900 -s 10.0.100.0/24 -j ACCEPT
iptables -A INPUT -p udp --dport 1900 -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

