Summary
A critical HTTP request smuggling vulnerability in Mongoose allows an unauthenticated remote attacker to create inconsistent request boundaries between Mongoose and a reverse proxy.
By sending both Content-Length and Transfer-Encoding: chunked, an attacker may desynchronize HTTP processing and inject requests that access or modify resources in another user's context.
Affected context
The issue occurs in Mongoose deployments where the embedded HTTP server operates behind a reverse proxy or intermediary that interprets conflicting message-framing headers differently. Risk is present when Mongoose accepts both Content-Length and Transfer-Encoding: chunked instead of rejecting ambiguous requests, while an upstream component prioritizes the headers in a different way.
Exploit preconditions
- Attack surface: Network-accessible HTTP service
- Required access: No authentication is generally required
- Trigger point: Processing a request containing both
Content-LengthandTransfer-Encoding: chunked - Why exploitation is possible: Mongoose and a front-end proxy may calculate different request boundaries, allowing attacker-controlled data to be interpreted as a separate request
Why this happens
The vulnerability is caused by inconsistent handling of conflicting HTTP message-framing headers. The HTTP parser accepts both Content-Length and Transfer-Encoding, while related processing paths prioritize chunked encoding rather than rejecting the ambiguous request.
If a reverse proxy prefers Content-Length, the two components can disagree about where one request ends and the next begins. This maps to CWE-444: Inconsistent Interpretation of HTTP Requests, commonly associated with HTTP request smuggling and request desynchronization.
Potential impact
- An attacker may bypass front-end request-routing assumptions
- Injected requests could access resources belonging to another user
- Injected requests could modify or delete application resources
- Authentication or authorization boundaries could be weakened
- Shared connections may be poisoned or desynchronized
- Downstream services could process unintended attacker-controlled requests
General mitigation guidance
Mitigation typically focuses on enforcing one consistent interpretation of HTTP message framing across every proxy, gateway, and origin server.
Common defensive patterns include:
- Rejecting requests that contain both
Content-LengthandTransfer-Encoding - Applying consistent HTTP parsing and framing policies across intermediaries
- Normalizing or removing ambiguous headers before forwarding requests
- Preventing direct access to origin services when a proxy is expected to enforce policy
- Limiting backend privileges and isolating user contexts
- Using connection handling policies that reduce the impact of parser disagreement
These controls reduce desynchronization risk without relying solely on authentication or application-layer validation.
How teams detect issues like this
Organizations commonly detect request smuggling risks through:
- Static analysis and code review for parsers that accept conflicting framing headers
- Tests that compare request-boundary handling between proxies and origin servers
- HTTP gateway policies that reject ambiguous or malformed requests
- Monitoring for unusual pipelining, connection reuse, delayed responses, or mismatched request counts
- Security testing of every proxy-to-origin path using harmless framing-ambiguity cases
Automated application-security and API-gateway policy checks can help identify inconsistent HTTP parsing during development and deployment reviews.

