Skip to content

Fix buffer overflow in resolve_full_path#997

Open
buzz wants to merge 1 commit into
dethrace-labs:mainfrom
buzz:fix/buffer-overflow
Open

Fix buffer overflow in resolve_full_path#997
buzz wants to merge 1 commit into
dethrace-labs:mainfrom
buzz:fix/buffer-overflow

Conversation

@buzz

@buzz buzz commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

The resolve_full_path() function in src/harness/os/linux.c and src/harness/os/macos.c uses a static buffer _program_name[1024], but calls getcwd(path, PATH_MAX) where PATH_MAX is 4096 on Linux. This causes getcwd() to write up to 4096 bytes into a 1024-byte buffer, triggering a stack buffer overflow.

The crash is detected by glibc's _FORTIFY_SOURCE=3 protection.

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