Skip to content

Reject NULL channel list entries in exr_attr_chlist_duplicate()#2473

Open
cary-ilm wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
cary-ilm:GHSA-mqmw-xv8w-5jh4
Open

Reject NULL channel list entries in exr_attr_chlist_duplicate()#2473
cary-ilm wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
cary-ilm:GHSA-mqmw-xv8w-5jh4

Conversation

@cary-ilm

Copy link
Copy Markdown
Member

Validate num_channels > 0 with entries == NULL before pointer arithmetic, covering exr_set_channels() and exr_attr_set_channels().

Also, refactor exr_attr_set_channels to call exr_attr_chlist_duplicate() since it does the same work.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-mqmw-xv8w-5jh4

Validate num_channels > 0 with entries == NULL before pointer
arithmetic, covering exr_set_channels() and exr_attr_set_channels().

Also, refactor exr_attr_set_channels to call exr_attr_chlist_duplicate()
since it does the same work.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-mqmw-xv8w-5jh4

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
@kthurston

Copy link
Copy Markdown

I guess this is ok, although I feel like I had a specific example where there were 0 channels in the channel list entry (like the old library supported this), and so allowed an "empty" channel list. If you have a test case for this, could you run it against a 2.x version of exr to see what the reader would do?

Somewhat separately, but related, I do think we should entertain an exr part with no image data (which would have no channels in it), although that by definition shouldn't then have a channel list attribute, but that channel list pointer in the part would be null and num_channels would be 0...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants