-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Describe the Bug
A bad ELF File which can lead elf_segment_iterator_next() to access out of bound memory or memory leak due to malformed e_phnum value.
To Reproduce
To Reproduce afl-fuzz:
Note: Most of them are just my laziness, usually I just copy/paste the environment values.
CC=afl-cc CXX=afl-c++ CFLAGS="-g -flto=auto" CXXFLAGS=-g CPPFLAGS=-g PKG_CONFIG_PATH=./build ./configure --prefix=$PWDdeleted dl from required packagesCC=afl-cc CXX=afl-c++ CFLAGS="-g -flto=auto" CXXFLAGS=-g CPPFLAGS=-g AR=llvm-ar make -j24 all- INSTRUMENTATIONS
export AFL_LLVM_CMPLOG=1
export AFL_LLVM_LAF_ALL=1
export AFL_USE_CFISAN=1 Expected Behaviour
Parse and Detect the e_phnum anomaly, refuse to allocate memory for non-existent segments and exit gracefully.
Environment
- System and Version:
Linux 6.2.10-zen1-1-zen x86_64 GNU/Linux, clang version 15.0.7 - Target file:
examples/elfparse
Additional Comments
Found more bugs with the dead_bytes.bin binary that is produced by libgolf.h as one and only unique seed but they need more time to triage.

Metadata
Metadata
Assignees
Labels
No labels