/

CVE-2026-57488

Severity:

HIGH RISK

(7.1)

Integer Overflow (CWE-190) in pupnp HTTP Request Parser

CVE-2026-57488

Analyzed

Vulnerability type

Category:

Integer Overflow and HTTP Request Smuggling

CWE:

CWE-190, CWE-444

Impact:

HTTP Request Desynchronization and Denial of Service

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

pupnp contains an integer conversion flaw in HTTP Content-Length parsing that can cause declared body sizes to be truncated or wrapped on some systems. A remote adjacent-network peer may exploit parser disagreement to cause HTTP request desynchronization in persistent or proxied connections, or trigger excessive waiting and denial of service.

pupnp contains an integer conversion flaw in HTTP Content-Length parsing that can cause declared body sizes to be truncated or wrapped on some systems. A remote adjacent-network peer may exploit parser disagreement to cause HTTP request desynchronization in persistent or proxied connections, or trigger excessive waiting and denial of service.

Affected context

The issue occurs in pupnp's HTTP parser when Content-Length values are converted from a wide integer type to a 32-bit signed integer and later stored as an unsigned value. It is most relevant on LP64 systems and in deployments that process persistent connections, proxy traffic, or allow adjacent-network peers to send HTTP requests.

The issue occurs in pupnp's HTTP parser when Content-Length values are converted from a wide integer type to a 32-bit signed integer and later stored as an unsigned value. It is most relevant on LP64 systems and in deployments that process persistent connections, proxy traffic, or allow adjacent-network peers to send HTTP requests.

Exploit preconditions

  • Attack surface: Network-accessible UPnP HTTP service or control-point parser
  • Required access: Ability to send HTTP requests from an adjacent network
  • Trigger point: Parsing an oversized or boundary-value Content-Length header
  • Why exploitation is possible: A wide parsed value can be truncated or wrapped during conversion, causing the parser and the sender, proxy, or downstream component to calculate different body boundaries
  • Attack surface: Network-accessible UPnP HTTP service or control-point parser
  • Required access: Ability to send HTTP requests from an adjacent network
  • Trigger point: Parsing an oversized or boundary-value Content-Length header
  • Why exploitation is possible: A wide parsed value can be truncated or wrapped during conversion, causing the parser and the sender, proxy, or downstream component to calculate different body boundaries

Why this happens

The parser uses strtol to obtain a wide integer, then casts the result to a 32-bit signed integer before the caller stores it as an unsigned value. Values outside the representable range can therefore lose information or change interpretation. This maps primarily to CWE-190: Integer Overflow or Wraparound and can contribute to CWE-444: Inconsistent Interpretation of HTTP Requests, because different components may disagree about where one request ends and another begins.

The parser uses strtol to obtain a wide integer, then casts the result to a 32-bit signed integer before the caller stores it as an unsigned value. Values outside the representable range can therefore lose information or change interpretation. This maps primarily to CWE-190: Integer Overflow or Wraparound and can contribute to CWE-444: Inconsistent Interpretation of HTTP Requests, because different components may disagree about where one request ends and another begins.

Potential impact

  • HTTP request desynchronization in persistent connections
  • Request smuggling or unintended interpretation by proxies and back-end services
  • Worker threads or processes waiting for an impractically large body
  • Denial of service through connection or resource exhaustion
  • Unexpected handling of subsequent requests or application data
  • HTTP request desynchronization in persistent connections
  • Request smuggling or unintended interpretation by proxies and back-end services
  • Worker threads or processes waiting for an impractically large body
  • Denial of service through connection or resource exhaustion
  • Unexpected handling of subsequent requests or application data

General mitigation guidance

Mitigation typically focuses on making length parsing range-safe and ensuring every HTTP component applies the same framing rules.

Common defensive patterns include:

  • Parse Content-Length using a type and validation routine that cannot silently narrow or wrap values
  • Reject negative, oversized, malformed, or ambiguous length values before storing or using them
  • Apply consistent maximum body-size and timeout limits across parsers, proxies, and back-end services
  • Prefer secure-by-default HTTP framing behavior that rejects conflicting or inconsistent requests
  • Minimize parser privilege and isolate network-facing workers from sensitive resources
  • Treat client-supplied length metadata as untrusted until it passes range and policy validation

Mitigation typically focuses on making length parsing range-safe and ensuring every HTTP component applies the same framing rules.

Common defensive patterns include:

  • Parse Content-Length using a type and validation routine that cannot silently narrow or wrap values
  • Reject negative, oversized, malformed, or ambiguous length values before storing or using them
  • Apply consistent maximum body-size and timeout limits across parsers, proxies, and back-end services
  • Prefer secure-by-default HTTP framing behavior that rejects conflicting or inconsistent requests
  • Minimize parser privilege and isolate network-facing workers from sensitive resources
  • Treat client-supplied length metadata as untrusted until it passes range and policy validation

How teams detect issues like this

Organizations can detect related weaknesses through:

  • Static analysis for narrowing conversions from long or other wide types into signed 32-bit integers
  • Code review of Content-Length parsing, integer casts, range checks, and unsigned conversions
  • Tests using boundary values around zero, INT_MAX, UINT_MAX, and implementation-specific limits
  • Integration testing through persistent connections and proxy chains to identify framing disagreements
  • Network monitoring for malformed or unusually large Content-Length headers and repeated incomplete bodies
  • Policy enforcement requiring centralized HTTP parsing and explicit maximum body-size controls

Automated code-review and security-testing tools may help identify suspicious conversion and request-framing patterns.

Organizations can detect related weaknesses through:

  • Static analysis for narrowing conversions from long or other wide types into signed 32-bit integers
  • Code review of Content-Length parsing, integer casts, range checks, and unsigned conversions
  • Tests using boundary values around zero, INT_MAX, UINT_MAX, and implementation-specific limits
  • Integration testing through persistent connections and proxy chains to identify framing disagreements
  • Network monitoring for malformed or unusually large Content-Length headers and repeated incomplete bodies
  • Policy enforcement requiring centralized HTTP parsing and explicit maximum body-size controls

Automated code-review and security-testing tools may help identify suspicious conversion and request-framing patterns.

Sources

SourceLink
github.comgithub.com/pupnp/pupnp/commit/de9602aef34ff722f3630d66c9be8eaa0aa9f012
github.comgithub.com/pupnp/pupnp/releases/tag/release-2.0.2
github.comgithub.com/pupnp/pupnp/security/advisories/GHSA-g6c2-x4r9-352g

Frequently asked

questions

Yes, in deployments where an adjacent-network peer can send traffic to the affected pupnp HTTP parser. The practical impact depends on connection persistence, proxying, and surrounding network controls.

The attacker generally needs network reachability to a UPnP service or control-point endpoint. Local or authenticated application access is not necessarily required when the service is exposed to the adjacent network.

Use range-checked parsing with a suitably wide size type, reject values that cannot be represented safely, and enforce consistent request-framing rules across all HTTP components.

Combine integer-conversion analysis with boundary-value tests, shared parser policies, strict body-size limits, connection timeouts, and monitoring for malformed HTTP length headers.

Yes, in deployments where an adjacent-network peer can send traffic to the affected pupnp HTTP parser. The practical impact depends on connection persistence, proxying, and surrounding network controls.

The attacker generally needs network reachability to a UPnP service or control-point endpoint. Local or authenticated application access is not necessarily required when the service is exposed to the adjacent network.

Use range-checked parsing with a suitably wide size type, reject values that cannot be represented safely, and enforce consistent request-framing rules across all HTTP components.

Combine integer-conversion analysis with boundary-value tests, shared parser policies, strict body-size limits, connection timeouts, and monitoring for malformed HTTP length headers.

Find out what's already
exploitable in your codebase.