Use of uninitialized value in memarea_strdup (src/common/memarea.c:369)
A fuzzing harness for Tor's hidden service descriptor parser triggered a use of uninitialized memory when calling strlen on a buffer. An attacker could potentially cause undefined behaviour or information disclosure, though the report only shows a crash under MemorySanitizer.
- Disclosed after 19 days
Triggered in 51e4748 , compiled with clang 6.0.0-trunk and -fsanitize=memory.
./fuzz-hsdescv2 < test001
Uninitialized bytes in __interceptor_strlen at offset 0 inside [0x7fff5525ff80, 51)
==19693==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5570edfe5fbd in memarea_strdup /root/tor/src/common/memarea.c:369:14
#1 0x5570edc4d77c in get_next_token /root/tor/src/or/parsecommon.c
#2 0x5570edc4a097 in tokenize_string /root/tor/src/or/parsecommon.c:72:11
#3 0x5570edda67f7 in rend_parse_v2_service_descriptor /root/tor/src/or/routerparse.c:5197:7
#4 0x5570ed946d02 in fuzz_main /root/tor/src/test/fuzz/fuzz_hsdescv2.c:40:10
#5 0x5570ed94677a in main /root/tor/src/test/fuzz/fuzzing_common.c:179:3
#6 0x7fee60f8a3f0 in __libc_start_main /build/glibc-mXZSwJ/glibc-2.24/csu/../csu/libc-start.c:291
#7 0x5570ed8d47d9 in _start (/root/tor/src/test/fuzz/fuzz-hsdescv2+0x717d9)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /root/tor/src/common/memarea.c:369:14 in memarea_strdup
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a buffer or string was used before being fully initialised, so strlen read uninitialised bytes.
Impact
The report only demonstrates a crash under MemorySanitizer; it does not show whether an attacker could exploit this for information disclosure or code execution.
What the attacker needed
Ability to run the fuzz-hsdescv2 harness with a crafted…
How it was found
- Build the fuzz-hsdescv2 harness with clang and -fsanitize=memory.
- Run the harness with the provided test input file.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a bug found by a fuzzer, a tool that feeds random input to a program to find crashes. The program read some memory that had never been given a value, and then tried to measure a string in it, which is undefined behaviour. The report only shows the crash under a special memory-checking tool, not a full exploit.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.