-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add advisory for Stack-buffer-overflow in xmas-elf #2235
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
```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" = ["*"] } | ||
|
||
[versions] | ||
patched = [] | ||
``` | ||
# 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs major copy editing. Suggestion:
|
||
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. |
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 a release