/

CVE-2026-28497

Severity:

CRITICAL RISK

(9.1)

HTTP Request Smuggling via Integer Overflow in TinyWeb HTTP

CVE-2026-28497

Analyzed

Vulnerability type

Category:

HTTP Request Smuggling via Integer Overflow

CWE:

CWE-190, CWE-444

Impact:

HTTP Request Smuggling and Security Control Bypass

Severity:

CRITICAL RISK

(9.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

TinyWeb web server versions prior to 2.03 contain an integer overflow in the string-to-integer conversion routine used to process the HTTP Content-Length header.

By crafting oversized or boundary-value Content-Length values, an unauthenticated remote attacker can desynchronize HTTP message parsing and perform request smuggling, potentially bypassing security controls and poisoning downstream caches on persistent (Keep-Alive) connections.

Affected context

This vulnerability arises in TinyWeb deployments (HTTP/HTTPS) on Win32 where:

  • The server is running a version earlier than 2.03
  • HTTP persistent connections (Keep-Alive) are enabled or commonly used
  • TinyWeb is fronted by, or chained with, other HTTP intermediaries such as proxies, load balancers, or caching servers
  • The server relies on Content-Length for request delimitation and may enforce size-based restrictions or filtering

Under these conditions, mismatches in perceived request boundaries between TinyWeb and downstream components can be triggered by maliciously crafted Content-Length headers.

Exploit preconditions

  • Attack surface: Public-facing HTTP/HTTPS listener of a TinyWeb instance.
  • Required access: No authentication required; attacker only needs the ability to send raw HTTP requests to the server.
  • Trigger point: Submission of HTTP requests containing specially crafted Content-Length values that cause integer overflow in the _Val conversion routine.
  • Why exploitation is possible:
  • The server converts the string value of Content-Length to an integer without robust overflow detection.
  • The resulting integer value differs from the actual intended length, causing TinyWeb and any chained intermediaries to disagree on where a request ends.
  • On persistent connections, this desynchronization enables one logical TCP connection to carry multiple, attacker-controlled HTTP messages that are parsed inconsistently, enabling request smuggling.

Why this happens

The core issue is an integer overflow (CWE-190) in TinyWeb's _Val routine, which parses the Content-Length header from a string into a numeric type without enforcing safe bounds or rejecting values that exceed the representable range.

When a specially crafted, overly large, or edge-case Content-Length is processed, the computed integer wraps around, yielding an incorrect effective content length.

This flawed length is then used to determine HTTP request boundaries, aligning with CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling'), where different components in the HTTP processing chain (TinyWeb vs. proxies/caches/filters) interpret the same stream differently.

Abstractly, the pattern is:

  • Trusting attacker-controlled protocol metadata (headers) for message framing
  • Performing unsafe numeric conversion without overflow checks
  • Relying on the resulting value as a security-relevant delimiter for downstream processing.

Potential impact

  • Unauthorized access to protected resources via desynchronized, smuggled requests that bypass front-end filters or authentication layers.
  • Bypass of security filters, WAF rules, or size-based inspection policies that rely on accurate Content-Length handling.
  • HTTP cache poisoning, where attacker-controlled responses are stored and later served to other users.
  • Execution of unintended requests under another user's session or origin context within complex deployments.
  • Potential leverage of desynchronization for session fixation, CSRF amplification, or credential harvesting in multi-tier architectures.
  • Disruption or degradation of service through malformed request streams that confuse intermediaries.

General mitigation guidance

Effective mitigation focuses on robust request framing, safe numeric handling, and defense in depth around HTTP parsing:

  • Use hardened string-to-integer conversion routines that:
  • Enforce strict upper and lower bounds on acceptable Content-Length values
  • Explicitly detect and reject overflow or malformed numeric representations
  • Fail closed (terminate the connection or reject the request) on parsing anomalies
  • Normalize and validate all request metadata used for message delimitation, especially Content-Length and Transfer-Encoding, ensuring only one framing mechanism is accepted per request.
  • Treat large or unusual Content-Length values as suspicious, applying conservative limits and rejecting values that approach integer boundaries or configured maximum body sizes.
  • Configure intermediaries (proxies, load balancers, caches) to use consistent HTTP parsing rules and to drop ambiguous or conflicting requests rather than attempting to guess intent.
  • Prefer secure-by-default HTTP server configurations that:
  • Disable or strictly manage Keep-Alive where parsing inconsistencies cannot be ruled out
  • Apply least-privilege principles to downstream components that act on parsed requests.
  • Introduce centralized parsing libraries or middleware so all components interpret HTTP messages consistently, rather than reimplementing parsing logic in multiple places.

How teams detect issues like this

Organizations can identify and monitor for this vulnerability class using a mix of code-level and runtime approaches:

  • Static analysis and code review:
  • Flag uses of custom or low-level string-to-integer routines for header parsing, especially for Content-Length.
  • Review boundary checks on numeric conversions, verifying that overflow is handled explicitly.
  • Look for multiple independent HTTP parsing implementations instead of shared, vetted libraries.
  • Ensure that header parsing and request framing paths treat parsing failures as hard errors, not silently corrected values.
  • Security testing and fuzzing:
  • Apply HTTP protocol fuzzers that vary Content-Length values, including extremely large numbers, negative values, leading zeros, and conflicting headers.
  • Conduct request smuggling tests against the full chain (client → proxy/load balancer → TinyWeb → backends) to detect inconsistencies.
  • Operational monitoring:
  • Monitor logs for parsing anomalies such as repeated connection resets, truncated bodies, or unexpected 4xx/5xx bursts associated with unusual Content-Length values.
  • Instrument reverse proxies and WAFs to alert on ambiguous requests (e.g., both Content-Length and Transfer-Encoding, or improbable body size headers).
  • Automated tooling:
  • Integrate HTTP parser consistency checks into CI/CD pipelines.
  • Use security scanners capable of probing for request smuggling patterns as part of pre-deployment testing.

Sources

SourceLink
github.comgithub.com/maximmasiutin/TinyWeb/commit/d2edd0322c3d74beee0a6c0191299b8946695d4e
github.comgithub.com/maximmasiutin/TinyWeb/security/advisories/GHSA-rp8j-cx7r-mw9f

Frequently asked

questions

Yes. An attacker only needs network-level access to send crafted HTTP/HTTPS requests to a TinyWeb server; no prior authentication is required. Exploitability increases in environments where TinyWeb is part of a chain with proxies or caches.

The attacker requires the ability to open HTTP or HTTPS connections to the TinyWeb instance and control request headers and bodies. No local access or credentials are necessary, although internal services may also be at risk if exposed over HTTP.

Adopt strict, overflow-aware numeric parsing for all length and size headers, enforce clear upper bounds on request body sizes, and reject any request that cannot be parsed unambiguously. Additionally, align HTTP parsing behavior across all components (server, proxies, caches) to avoid desynchronization.

Use well-tested HTTP parsing libraries instead of bespoke implementations, apply defensive programming to all protocol metadata (including explicit overflow checks), and include request smuggling tests in your security testing regimen. Establish coding standards that prohibit unchecked numeric conversions for security-critical values like Content-Length and require comprehensive validation at protocol boundaries.

Find out what's already
exploitable in your codebase.