Skip to content

Conversation

bmribler
Copy link
Collaborator

@bmribler bmribler commented Sep 27, 2025

This PR hardens H5C__decode_cache_image_header() by adding buffer overflow checks. It doesn't specifically address a CVE issue, but simply responds to this comment in PR #5841.


Important

Add buffer overflow checks to H5C__decode_cache_image_header() in H5Cimage.c for security hardening.

  • Security Hardening:
    • Add buffer overflow checks in H5C__decode_cache_image_header() in H5Cimage.c.
    • Use H5_IS_BUFFER_OVERFLOW() to verify buffer space before accessing elements.
    • Checks added for signature, version, flags, image data length, and number of entries.
  • Misc:
    • Adjust H5C__reconstruct_cache_contents() to use updated buffer handling logic.

This description was created by Ellipsis for df86e9d. You can customize this summary. It will automatically update as commits are pushed.

@bmribler bmribler mentioned this pull request Sep 27, 2025
p += H5C__MDCI_BLOCK_SIGNATURE_LEN;

/* Check version */
if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The buffer overflow check above if (H5_IS_BUFFER_OVERFLOW(p, H5C__MDCI_BLOCK_SIGNATURE_LEN, *buf + buf_size - 1)) should probably be updated to make use of p_end instead for consistency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhendersonHDF I made the change. Thanks!

@lrknox lrknox merged commit 09e3cfe into HDFGroup:develop Oct 15, 2025
90 checks passed
@github-project-automation github-project-automation bot moved this from To be triaged to Done in HDF5 - TRIAGE & TRACK Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants