Skip to content

Fix missing INT_MAX cap on deep scanline sample_count_table_size#2535

Merged
cary-ilm merged 2 commits into
AcademySoftwareFoundation:mainfrom
cary-ilm:fix-GHSA-m5cq-cx25-qw53
Jul 14, 2026
Merged

Fix missing INT_MAX cap on deep scanline sample_count_table_size#2535
cary-ilm merged 2 commits into
AcademySoftwareFoundation:mainfrom
cary-ilm:fix-GHSA-m5cq-cx25-qw53

Conversation

@cary-ilm

@cary-ilm cary-ilm commented Jul 9, 2026

Copy link
Copy Markdown
Member

ddata[1] (packed_size) and ddata[2] (unpacked_size) both had '< 0 || > INT_MAX' guards, but ddata[0] (sample_count_table_size) only had '< 0'. A value > INT_MAX stored in the uint64_t field then gets truncated to size_t on ILP32, causing an undersized allocation followed by a heap overflow when exr_read_deep_chunk writes the full 64-bit byte count into it.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-m5cq-cx25-qw53

ddata[1] (packed_size) and ddata[2] (unpacked_size) both had
'< 0 || > INT_MAX' guards, but ddata[0] (sample_count_table_size)
only had '< 0'. A value > INT_MAX stored in the uint64_t field then
gets truncated to size_t on ILP32, causing an undersized allocation
followed by a heap overflow when exr_read_deep_chunk writes the full
64-bit byte count into it.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-m5cq-cx25-qw53

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

@peterhillman peterhillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good

@cary-ilm cary-ilm added the v3.4 label Jul 14, 2026
@cary-ilm cary-ilm merged commit b2ed287 into AcademySoftwareFoundation:main Jul 14, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants