Skip to content

Don't read past the end of input when a macro value is missing - #3

Merged
sobomax merged 1 commit into
masterfrom
wip
Nov 17, 2026
Merged

sobomax merged 1 commit into
masterfrom
wip

Conversation

@sobomax

@sobomax sobomax commented Nov 17, 2026

Copy link
Copy Markdown
Member

ucl_parse_macro_value() dereferenced chunk->pos without checking it
against chunk->end. Input that ends right after a macro's arguments,
e.g. ".priority(a=1)" optionally followed by whitespace or a comment,
caused a one-byte overread; with ucl_parser_add_fd() the input is
mmap'ed, so the read hits an unmapped page and crashes.

Report a "macro value is missing" syntax error instead, and add a
regression test that places each input at a page boundary followed by
a PROT_NONE guard page.

Found by OSS-Fuzz (rtpproxy fuzz_config_file), issue 586655978.

Fixes the rtpproxy fuzz_config_file crash (ucl_parse_macro_value, UNKNOWN READ) reported on the libfuzzer_ubsan / libfuzzer_asan / afl_asan / honggfuzz_asan jobs. Adds tests/test_macro_eof.c regression test.

ucl_parse_macro_value() dereferenced chunk->pos without checking it
against chunk->end. Input that ends right after a macro's arguments,
e.g. ".priority(a=1)" optionally followed by whitespace or a comment,
caused a one-byte overread; with ucl_parser_add_fd() the input is
mmap'ed, so the read hits an unmapped page and crashes.

Report a "macro value is missing" syntax error instead, and add a
regression test that places each input at a page boundary followed by
a PROT_NONE guard page.

Found by OSS-Fuzz (rtpproxy fuzz_config_file), issue 586655978.
@sobomax
sobomax merged commit 429fae5 into master Nov 17, 2026
4 checks passed
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