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

Early check of header size if ELF64 is detected #2

Merged

Conversation

samueltardieu
Copy link
Contributor

@samueltardieu samueltardieu commented Jul 24, 2020

By feeding Elf::from_bytes() the first 52 bytes of a ELF64 header, it is possible to have the function read past the buffer given as parameter because the ehsize field is at a greater offset.

The bug has been found using cargo fuzz and can be demonstrated using the following base64 input to Elf::from_bytes() once
decoded:

f0VMRgL//zQACszMzcwrCgoKClkKCszMzcwrCgoKzAqmplpZWQooCkdZWf9GyQAAuLi4uA==

By feeding `Elf::from_bytes()` the first 52 bytes of a ELF64
header, it is possible to have the function read past the
buffer given as parameter because the `ehsize` field is at
a greater offset.

The bug has been found using `cargo fuzz`.
@vincenthouyi vincenthouyi merged commit d040e18 into vincenthouyi:master Jul 25, 2020
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.

None yet

2 participants