Opened 2 years ago

Closed 8 weeks ago

#16235 closed enhancement (overcomebyevents)

Fix CVE-2021-3575 in OpenJPEG (Wait for upstream consensus)

Reported by: Douglas R. Reno Owned by: Douglas R. Reno
Priority: lowest Milestone: 12.2
Component: BOOK Version: git
Severity: normal Keywords:
Cc:

Description

OpenJPEG-2.4.0 is vulnerable to a heap buffer overflow that is known to lead to arbitrary code execution.

A fix can be found here: https://github.com/msabwat/openjpeg/commit/f4cb033a340b55dbc576453c4b6a967fec5cbbda

The most recent report for the vulnerability was June 2021.

Change History (15)

comment:1 by Douglas R. Reno, 2 years ago

Owner: changed from blfs-book to Douglas R. Reno
Status: newassigned

comment:2 by pierre, 2 years ago

Hmmm, upstream does not seem to be convinced by the fix! https://github.com/uclouvain/openjpeg/pull/1362

comment:3 by Douglas R. Reno, 2 years ago

For what it's worth, I got it from here: https://www.cisa.gov/uscert/ncas/bulletins/sb22-073

I get an email on a weekly basis that details all recent vulnerabilities that the US Government is aware of

comment:4 by pierre, 2 years ago

Actually, the problem seems to be that the fix breaks one of the tests, so that they do not know what to do... And they seem to not be sure whether the fix introduces other issues or not. But it is amazing they have remained silent for 9 months now. Or maybe they discuss privately since it is security related.

In any case, the file src/bin/common/color.c has not been modified in master since April 2020. So the fix is not applied upstream (at least publicly).

in reply to:  4 ; comment:6 by Douglas R. Reno, 2 years ago

Replying to pierre:

Actually, the problem seems to be that the fix breaks one of the tests, so that they do not know what to do... And they seem to not be sure whether the fix introduces other issues or not. But it is amazing they have remained silent for 9 months now. Or maybe they discuss privately since it is security related.

In any case, the file src/bin/common/color.c has not been modified in master since April 2020. So the fix is not applied upstream (at least publicly).

Yeah the fix has not been applied upstream, and I'm not sure where exactly Red Hat got their patches from for this.

What's interesting is that https://github.com/uclouvain/openjpeg/issues/1347 mentions making the issue public, even though it's not fixed!

comment:7 by Joe Locash, 2 years ago

RedHat uses the patch you posted in the initial ticket. Their source can be found here:

http://vault.centos.org/8-stream/AppStream/Source/SPackages/openjpeg2-2.4.0-4.el8.src.rpm

comment:8 by Xi Ruoyao, 2 years ago

The problem is we don't know if the patch is a correct fix, or just papering over the ASAN warn without fixing the underlying issue. And it seems even the upstream maintainer also doesn't know...

Is there any expert in image processing here? :)

in reply to:  6 comment:9 by Xi Ruoyao, 2 years ago

Replying to Douglas R. Reno:

Yeah the fix has not been applied upstream, and I'm not sure where exactly Red Hat got their patches from for this.

What's interesting is that https://github.com/uclouvain/openjpeg/issues/1347 mentions making the issue public, even though it's not fixed!

It looks like some CTF guy submitted a public issue improperly, maybe to improve his reputation in CTF area. I don't like those competition participants not obeying the rule of the open source community.

Last edited 2 years ago by Xi Ruoyao (previous) (diff)

comment:10 by Douglas R. Reno, 2 years ago

Milestone: 11.299-Waiting
Summary: Fix CVE-2021-3575 in OpenJPEGFix CVE-2021-3575 in OpenJPEG (Wait for upstream consensus)

comment:11 by Douglas R. Reno, 2 years ago

Priority: elevatedlowest

comment:12 by Xi Ruoyao, 2 years ago

We should definitely not use the suggested patch.

That patch, modifies openjpeg/src/bin/common/color.c, which is not a part of libopenjp2.so. So if the patch is really correct, this vulnerability is actually not exploitable unless you run a tool shipped by openjpeg. Then there is no urgency to use it. Otherwise, the patch is useless to prevent a real attack (by putting a malicious j2k image on a web page etc.).

comment:13 by Douglas R. Reno, 21 months ago

Resolution: wontfix
Status: assignedclosed

comment:14 by Xi Ruoyao, 8 weeks ago

Milestone: 99-Waiting12.2
Resolution: wontfix
Status: closedreopened

comment:15 by Xi Ruoyao, 8 weeks ago

Resolution: overcomebyevents
Status: reopenedclosed

Fixed with #19370.

Note: See TracTickets for help on using tickets.