Description:
Current implementation uses data.includes("\r\n\r\n") to detect request end. This is vulnerable to request smuggling if the body contains \r\n\r\n. Need to parse Content-Length header and only consider request complete when exact number of bytes received.
Tasks:
Files to modify:
src/httpServer.ts - data event handler
src/utils/utils.ts - parseRequestMessage function
References:
- RFC 7230 Section 3.3.3 (Message Body Length)
- CWE-444: HTTP Request Smuggling
Description:
Current implementation uses
data.includes("\r\n\r\n")to detect request end. This is vulnerable to request smuggling if the body contains\r\n\r\n. Need to parse Content-Length header and only consider request complete when exact number of bytes received.Tasks:
Content-Lengthheader from request headersheaderEndIndex + 4 + contentLengthdata.length >= expectedBytesFiles to modify:
src/httpServer.ts- data event handlersrc/utils/utils.ts- parseRequestMessage functionReferences: