-
Notifications
You must be signed in to change notification settings - Fork 388
Add advisory for Stack-buffer-overflow in xmas-elf #2235
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
59207d0
Create RUSTSEC-0000-0000.md
nyw0102 0c68acb
Merge branch 'rustsec:main' into main
nyw0102 c47a9d8
Update RUSTSEC-0000-0000.md
nyw0102 ccad69e
Update RUSTSEC-0000-0000.md
nyw0102 9f862af
Merge branch 'rustsec:main' into main
nyw0102 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
```toml | ||
[advisory] | ||
id = "RUSTSEC-0000-0000" | ||
package = "xmas-elf" | ||
date = "2025-03-03" | ||
url = "https://github.com/nrc/xmas-elf/issues/86" | ||
categories = ["memory-corruption"] | ||
|
||
[affected] | ||
functions = { "xmas_elf::hash::HashTable::get_bucket" = ["<0.10"] } | ||
|
||
[versions] | ||
patched = [">=0.10"] | ||
``` | ||
# Stack-buffer-overflow in HashTable Struct | ||
In this case, the "get_bucket" method within the HashTable struct uses the unsafe keyword to access memory with assert function protection. | ||
A maliciously crafted ELF file can present an invalid SectionData HashTable that causes xmas-elf to access memory out of bounds | ||
However, it is still vulnerable because "bucket_count" which stands for the size of hashtable and offset value of the hashtable can be manipulated by users. | ||
When "bucket_count" is set bigger value than first_bucket's actual length, it can lead to invalid memory access which violates Rust’s memory safety guarantees. | ||
Also, as hash.rs is public module, it can be used externally, which means that it is an actual vulnerability. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs major copy editing. Suggestion:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your suggestion. I will add the details based on your suggestion.