Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix overflow in URL parsing #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DavidKorczynski
Copy link

The fuzzer added in #102 finds an overflow in the URL parsing logic, with the following sanitizer report:

==13==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x5020001398f4 at pc 0x557be604430c bp 0x7ffe725a0400 sp 0x7ffe725a03f8
READ of size 1 at 0x5020001398f4 thread T0                       
SCARINESS: 12 (1-byte-read-heap-buffer-overflow)                 
    #0 0x557be604430b in http_parse_host /src/http-parser/./http_parser/http_parser.c:2015:58
    #1 0x557be604430b in http_parser_parse_url /src/http-parser/./http_parser/http_parser.c:2150:9
    #2 0x557be6039317 in LLVMFuzzerTestOneInput /src/fuzzer.c:19:3

This fixes it by ensuring the http_parse_host function does not beyond the buffer it uses for reading.

Signed-off-by: David Korczynski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant