Skip to content

Reject oversized Array2D allocations on ILP32#2540

Merged
cary-ilm merged 2 commits into
AcademySoftwareFoundation:mainfrom
cary-ilm:GHSA-h56j-j82x-w3fp
Jul 14, 2026
Merged

Reject oversized Array2D allocations on ILP32#2540
cary-ilm merged 2 commits into
AcademySoftwareFoundation:mainfrom
cary-ilm:GHSA-h56j-j82x-w3fp

Conversation

@cary-ilm

Copy link
Copy Markdown
Member

Array2D computed sizeX * sizeY in 32-bit arithmetic before new[]. On ILP32, a 65537 x 65537 allocation wraps to a tiny buffer while decode still writes the full image.

Validate the element count in uint64_t and reject dimensions whose product exceeds size_t before constructing or resizing Array2D.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-h56j-j82x-w3fp

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-wrw5-mm52-r3h8

Array2D computed sizeX * sizeY in 32-bit arithmetic before new[].
On ILP32, a 65537 x 65537 allocation wraps to a tiny buffer while
decode still writes the full image.

Validate the element count in uint64_t and reject dimensions whose
product exceeds size_t before constructing or resizing Array2D.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-h56j-j82x-w3fp

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-wrw5-mm52-r3h8

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.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 merged commit 04c52e7 into AcademySoftwareFoundation:main Jul 14, 2026
50 checks passed
@cary-ilm cary-ilm added the v3.4 label Jul 14, 2026
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