-
-
Notifications
You must be signed in to change notification settings - Fork 310
Fix CVE-2025-2310 #5872
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
Fix CVE-2025-2310 #5872
Conversation
2117873 to
a5a0b30
Compare
src/H5Oattr.c
Outdated
| HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); | ||
|
|
||
| /* Verify that retrieved name length (including null byte) is valid */ | ||
| if (name_len <= 1) |
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.
Shouldn't we find where name_len was decoded?
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.
It was decoded earlier in this function - UINT16DECODE(p, name_len); at H5Oattr.c:169. I wanted to put this check next to the other name_len value check.
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.
Hmm, I think this check is more appropriate right after the value being decoded.
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.
Should add a note to the CHANGELOG.md, but otherwise looks good
a5a0b30 to
cd43ae5
Compare
Malformed files can have a zero name-length, which when subtracted lead to an overflow and an out-of-bounds read.
Check that name length is not too small in addition to checking for an overflow directly.
Important
Fixes overflow and out-of-bounds read in
H5O__attr_decode()by ensuringname_lenis greater than 1 inH5Oattr.c.H5O__attr_decode()inH5Oattr.c, added a check to ensurename_lenis greater than 1 to prevent overflow and out-of-bounds read.This description was created by
for a5a0b30. You can customize this summary. It will automatically update as commits are pushed.