-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
[CVE-2021-45830] Heap Buffer Overflow in H5F_addr_decode_len() #2228
Labels
Component - C Library
Core C library issues (usually in the src directory)
Priority - 1. High 🔼
These are important issues that should be resolved in the next release
Type - Bug / Bugfix
Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub
Comments
e4t
added a commit
to e4t/hdf5
that referenced
this issue
Nov 7, 2022
Malformed hdf5 files may have trunkated content which does not match the expected size. This function attempts to decode these it will read past the end of the allocated space which may lead to a crash. Make sure each element is within bounds before reading. This fixes CVE-2021-45830 / Bug HDFGroup#2228. Signed-off-by: Egbert Eich <eich@suse.com> Additions
e4t
added a commit
to e4t/hdf5
that referenced
this issue
Nov 7, 2022
Malformed hdf5 files may have trunkated content which does not match the expected size. This function attempts to decode these it will read past the end of the allocated space which may lead to a crash. Make sure each element is within bounds before reading. This fixes CVE-2021-45830 / Bug HDFGroup#2228. Signed-off-by: Egbert Eich <eich@suse.com> Additions
e4t
added a commit
to e4t/hdf5
that referenced
this issue
Nov 9, 2022
Malformed hdf5 files may have trunkated content which does not match the expected size. This function attempts to decode these it will read past the end of the allocated space which may lead to a crash. Make sure each element is within bounds before reading. This fixes CVE-2021-45830 / Bug HDFGroup#2228. Signed-off-by: Egbert Eich <eich@suse.com> Additions
e4t
added a commit
to e4t/hdf5
that referenced
this issue
Nov 10, 2022
When decoding a file space info message in H5O__fsinfo_decode() make sure each element to be decoded is still within the message. Malformed hdf5 files may have trunkated content which does not match the expected size. Checking this will prevent attempting to decode unrelated data and heap overflows. So far, only free space manager address data was checked before decoding. This fixes CVE-2021-45830 / Bug HDFGroup#2228. Signed-off-by: Egbert Eich <eich@suse.com> Additions
e4t
added a commit
to e4t/hdf5
that referenced
this issue
Nov 10, 2022
When decoding a file space info message in H5O__fsinfo_decode() make sure each element to be decoded is still within the message. Malformed hdf5 files may have trunkated content which does not match the expected size. Checking this will prevent attempting to decode unrelated data and heap overflows. So far, only free space manager address data was checked before decoding. This fixes CVE-2021-45830 / Bug HDFGroup#2228. Signed-off-by: Egbert Eich <eich@suse.com> Additions
lrknox
added a commit
that referenced
this issue
Nov 11, 2022
When decoding a file space info message in H5O__fsinfo_decode() make sure each element to be decoded is still within the message. Malformed hdf5 files may have trunkated content which does not match the expected size. Checking this will prevent attempting to decode unrelated data and heap overflows. So far, only free space manager address data was checked before decoding. This fixes CVE-2021-45830 / Bug #2228. Signed-off-by: Egbert Eich <eich@suse.com> Additions Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
See #1314 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component - C Library
Core C library issues (usually in the src directory)
Priority - 1. High 🔼
These are important issues that should be resolved in the next release
Type - Bug / Bugfix
Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub
Description
CVE-2021-45830 provides a reproducer that causes a heap buffer overflow in H5F_addr_decode_len(). The issue is still seen in hdf5 version 1.13.3.
The cause of this is an incomplete bounds checking in the caller H5O__fsinfo_decode() as a buffer size verification is only done when decoding the file space address.
The heap overflow on read itself appears to be harmless from a security perspective. This may not be true for later memory accesses (possibly writes) based on inconsistent/invalid data read.
The overflow can be seen both with valgrind and the gcc address sanitizer (make CFLAGS="-g -fsanitize=address" CXXFLAGS="-g -fsanitize=address" FCFLAGS="-g -fsanitize=address")
Expected behavior
Detect invalid hdf5 data properly and trigger the appropriate error handler.
Handle buffer overflow condition properly to avoid possible vulnerabilities thru manipulated hdf5 data files brought in circulation by bad actors.
Platform
The text was updated successfully, but these errors were encountered: