nodejs / http-parser

http request/response parser for c
MIT License
6.35k stars 1.54k forks source link

http_parser_parse_url fails to handle very long URLs #481

Open piru opened 5 years ago

piru commented 5 years ago

http_parser_parse_url quietly fails to parse very long URLs. Instead it will return invalid off and len values. There could be a security impact in this issue in situations where the parse result data would be used to make security related decisions (for example the parsed path might be different in actual URL vs the parsed one).

PR #480 is a proposed fix to this issue. Alternatively if the existing ABI must be maintained, the code should be changed to return an error if off or len overflow (become > UINT16_MAX).