/

CVE-2026-38969

Severity:

HIGH RISK

(7.5)

HTTP Request Smuggling (CWE-444) in Ruby WEBrick

CVE-2026-38969

Deferred

Vulnerability type

Category:

HTTP Request Smuggling

CWE:

CWE-444

Impact:

Request Smuggling and HTTP Desynchronization

Severity:

HIGH RISK

(7.5)

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

Ruby's WEBrick HTTP server up to version 1.9.2 reparses the Content-Length value found in HTTP trailers into the canonical request state.

When deployed behind or alongside other HTTP components that interpret message boundaries differently, this mismatch can enable HTTP request smuggling and desynchronization attacks.

Affected context

This vulnerability appears in Ruby applications that use WEBrick (through v1.9.2) as an HTTP server, especially when WEBrick is part of a multi-hop architecture with reverse proxies, load balancers, API gateways, or TLS terminators in front of it.

The issue arises when upstream components and WEBrick disagree on which Content-Length value defines the request body, particularly when trailers are allowed or not fully normalized.

The risk is higher in deployments that accept HTTP/1.1 requests with chunked transfer-encoding or non-standard use of trailers.

Exploit preconditions

  • Attack surface: The HTTP endpoint exposed by WEBrick, often via public-facing web applications or APIs.
  • Required access: Ability to send crafted HTTP requests to a WEBrick-backed service (typically unauthenticated network access to the HTTP port).
  • Trigger point: Submission of a specially crafted HTTP/1.1 request that uses Content-Length in both headers and trailers (or interacts with trailer parsing) to cause WEBrick and any upstream component to disagree on request boundaries.
  • Why exploitation is possible: WEBrick reparses trailer Content-Length into its canonical request state, while other HTTP intermediaries may rely only on the initial headers or handle trailers differently. This parsing discrepancy allows an attacker to smuggle additional HTTP requests that are interpreted inconsistently across components.

Why this happens

The root cause is inconsistent handling of HTTP message delimitation, mapping to CWE-444: Inconsistent Interpretation of Input.

WEBrick processes Content-Length values found in HTTP trailers and promotes them to the canonical request metadata, treating them as authoritative for body length.

Other components (such as proxies) often make routing and buffering decisions solely based on header Content-Length or transfer-encoding without re-evaluating trailers.

This divergence creates a desynchronization window where a single physical TCP stream is interpreted as different logical request sequences by different participants in the request path.

Potential impact

  • Request smuggling that can cause one logical request to be split or merged across multiple backend requests.
  • Bypassing security controls implemented at the proxy or gateway layer, such as authentication, rate limiting, or WAF rules.
  • Poisoning of HTTP request queues, causing victim users' requests to inherit attacker-controlled headers or bodies.
  • Exposure of sensitive data if responses intended for one client are misrouted to another due to request desynchronization.
  • Potential cache poisoning or cache deception attacks where shared caches store attacker-shaped responses under victim-visible keys.

General mitigation guidance

Effective mitigation focuses on eliminating ambiguous request parsing and enforcing consistent HTTP message framing across the stack.

Common defensive patterns include:

  • Normalizing HTTP request handling so that only one authoritative source of Content-Length is used, ignoring or strictly validating conflicting information in trailers.
  • Disallowing or tightly constraining the use of HTTP trailers for incoming requests, especially in public-facing endpoints.
  • Enforcing strict HTTP parsing rules that reject requests with conflicting Content-Length or suspicious transfer-encoding combinations.
  • Aligning parsing behavior between WEBrick and fronting components (reverse proxies, load balancers) through harmonized configuration and policy.
  • Applying least-privilege principles at the HTTP layer by isolating administrative or sensitive endpoints from potentially smuggled traffic.

How teams detect issues like this

Detection usually combines code-level review and traffic analysis:

  • Static analysis and manual review for HTTP server code paths that reinterpret or overwrite canonical request metadata based on trailers or duplicate Content-Length fields.
  • Configuration review of reverse proxies and gateways to identify mismatches in HTTP parsing rules versus WEBrick's behavior, focusing on transfer-encoding and trailer processing.
  • Network-level monitoring for anomalous HTTP patterns (e.g., multiple Content-Length indicators, unusual use of trailers, or inconsistent body sizes).
  • Security testing using automated HTTP desynchronization and smuggling test suites to probe for divergent interpretations between components.

Sources

SourceLink
github.comgithub.com/ruby/webrick/blob/master/README.md
github.comgithub.com/ruby/webrick/issues/198
github.comgithub.com/ruby/webrick/pull/199

Frequently asked

questions

Yes, if WEBrick is reachable over the network. An attacker who can send crafted HTTP requests to a WEBrick-backed service can attempt to exploit the parsing discrepancy, particularly in fronted or proxied deployments.

Usually no. In many setups, HTTP request smuggling can be attempted against unauthenticated endpoints because the attack relies on protocol handling differences, not on application-level authorization. However, existing authentication layers may change the practical impact.

The safest pattern is to enforce a single, consistent interpretation of HTTP message boundaries: do not promote trailer Content-Length into canonical state, reject conflicting or malformed requests, and harmonize WEBrick's parsing behavior with that of any upstream proxies or gateways.

Prevention involves treating HTTP parsing as a shared contract across all components: adopt strict, standards-aligned parsers; disable risky protocol features like trailers where not needed; regularly test for request smuggling behaviors; and include HTTP desynchronization checks in security reviews and CI pipelines.

Find out what's already
exploitable in your codebase.