Replies: 1 comment
-
Node.js’s HTTP parser implements strict measures to prevent HTTP request smuggling attacks, which exploit differences in how front-end (e.g., proxies) and back-end servers interpret HTTP requests. These attacks occur when ambiguous or malformed requests are processed differently by servers in a chain, allowing attackers to "smuggle" malicious data past security controls. Below, I outline the specific measures in Node.js’s parser, the types of request smuggling attacks they block, and examples of vulnerabilities in less strict software, drawing on relevant cases. 1. Disallowing Status/Field Lines Ending with Bare LF
2. Disallowing Whitespace After Chunk Length
3. Disallowing Invalid Characters in HTTP/1.x Field Values
Recent Cases and Broader Implications
Specific Attacks and Impacts
Why Node.js’s Strictness MattersNode.js’s strict parser aligns with RFC 7230 and RFC 9112, rejecting non-compliant requests to ensure consistent interpretation across server chains. Less strict software (e.g., HAProxy, NGINX, ATS) prioritizes compatibility, tolerating deviations that attackers exploit. By enforcing CRLF, rejecting chunk extension whitespace, and validating field values, Node.js mitigates risks from ambiguous requests, especially in proxy-back-end setups. Recommendations for Other Software
ConclusionNode.js’s strict HTTP parser prevents CL.TE, TE.CL, TE.TE, and header injection request smuggling attacks by rejecting bare LF, whitespace after chunk lengths, and invalid characters in field values. These measures block exploits that rely on parser discrepancies, as seen in vulnerabilities like CVE-2021-22960, CVE-2022-35256, and issues in HAProxy, NGINX, and ATS. Less strict software amplifies risks, making Node.js’s approach a critical defense against real-world attacks like cache poisoning and credential theft. |
Beta Was this translation helpful? Give feedback.
-
From reading various comments, it is clear that Node.js’s HTTP parser is as strict as it is to prevent request smuggling attacks. However, it has never been explained what the particular attacks are.
In particular, Node.js does not allow:
Which specific attacks are blocked by these measures? Is there a concrete security vulnerability in any software that is not so strict?
Beta Was this translation helpful? Give feedback.
All reactions