Bug 23168 - jasper missing fix for security issue CVE-2016-9397
Summary: jasper missing fix for security issue CVE-2016-9397
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 7
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Nicolas Lécureuil
QA Contact: Sec team
URL:
Whiteboard:
Keywords:
Depends on: 24760 26690
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-11 12:55 CEST by David Walser
Modified: 2020-12-29 03:10 CET (History)
5 users (show)

See Also:
Source RPM: jasper-1.900.23-5.1.mga6.src.rpm
CVE:
Status comment:


Attachments

Description David Walser 2018-06-11 12:55:40 CEST
These issues were supposed to have been fixed in Bug 19605, but they were not, according to PoC testing here:
https://bugs.mageia.org/show_bug.cgi?id=23139#c10
David Walser 2018-06-11 12:55:53 CEST

Whiteboard: (none) => MGA6TOO, MGA5TOO

Comment 1 Marja Van Waes 2018-06-11 21:50:52 CEST
Assigning to the registered maintainer, CC'ing two committers.

Assignee: bugsquad => mageia
CC: (none) => geiger.david68210, marja11, nicolas.salguero

Thomas Backlund 2018-10-16 17:30:36 CEST

Whiteboard: MGA6TOO, MGA5TOO => MGA6TOO
CC: (none) => tmb

David Walser 2019-05-03 20:54:37 CEST

Depends on: (none) => 24760

Comment 2 David Walser 2019-05-04 23:09:49 CEST
CVE-2016-9398 fixed in Bug 24760.

Summary: jasper missing fixes for security issues CVEs 2016-939[78] => jasper missing fixes for security issues CVE-2016-9397

David Walser 2019-06-23 19:23:30 CEST

Whiteboard: MGA6TOO => MGA7TOO, MGA6TOO

Nicolas Lécureuil 2020-05-22 14:07:36 CEST

Whiteboard: MGA7TOO, MGA6TOO => MGA7TOO

David Walser 2020-05-27 00:06:26 CEST

Depends on: (none) => 26690

Comment 3 David GEIGER 2020-05-27 07:06:10 CEST
This security issue is still not fixed upstream and surely never will be:

https://github.com/mdadams/jasper/issues/56

And redhat closed their bug as WONTFIX:

https://bugzilla.redhat.com/show_bug.cgi?id=1485276
Comment 4 David Walser 2020-05-27 12:50:41 CEST
I don't see anything upstream that indicates it won't be fixed.  The correct RedHat bug is still open:
https://bugzilla.redhat.com/show_bug.cgi?id=1396979
Comment 5 David GEIGER 2020-05-27 13:31:18 CEST
Yes surely nothing indicates that upstream will not fix this issue but after more than 4 years...
Comment 6 David Walser 2020-05-27 13:36:27 CEST
They didn't say they don't intend to fix it, they said it's difficult to reproduce and they are a small volunteer effort like many open source projects.  When you get dozens of reported vulnerabilities through fuzzing, it can be difficult to fix them all quickly.  Just be patient.
David Walser 2020-05-27 13:41:52 CEST

Summary: jasper missing fixes for security issues CVE-2016-9397 => jasper missing fix for security issue CVE-2016-9397
Status comment: (none) => No fix available as of May 2020

Comment 7 David Walser 2020-05-27 14:06:07 CEST
I saw that Debian and Ubuntu dropped jasper, presumably due to security concerns.  Can we drop it too?  Can things be built against openjpeg/openjpeg2 instead?
David Walser 2020-12-28 17:09:38 CET

Whiteboard: MGA7TOO => MGA8TOO, MGA7TOO

Comment 8 David Walser 2020-12-29 00:19:56 CET
Someone posted upstream and claimed again that 1.900.26 fixed it in 2016.

I believe our QA team previously tested 1.900.23 when it was determined to not be fixed, so this second commit referenced on the upstream issue might have actually fixed it.  I sent a message to the qa-discuss list asking to test the PoC again.

Status comment: No fix available as of May 2020 => Need to test the PoC again, might already be fixed

Comment 9 David Walser 2020-12-29 00:20:21 CET
(In reply to David Walser from comment #7)
> I saw that Debian and Ubuntu dropped jasper, presumably due to security
> concerns.  Can we drop it too?  Can things be built against
> openjpeg/openjpeg2 instead?

We should also determine an answer to this question.
David Walser 2020-12-29 00:20:57 CET

Status comment: Need to test the PoC again, might already be fixed => Need to test the PoC again, might already be fixed, also this maybe could be dropped

Comment 10 Len Lawrence 2020-12-29 02:27:27 CET
Does this clear it up?

https://bugs.mageia.org/show_bug.cgi?id=23139
Quoting from https://bugs.mageia.org/attachment.cgi?id=10233
date = 2018-06-09
jasper-1.900.23-5.1.mga6
---------------------
CVE-2016-9397
https://github.com/asarubbo/poc/blob/master/00010-jasper-assert-jpc_dequantize
$ imginfo -f 00010-jasper-assert-jpc_dequantize
warning: ignoring invalid option max_samples
warning: ignoring unknown marker segment (0xff76)
type = 0xff76 (UNKNOWN); len = 20;00 40 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 imginfo: jpc_dec.c:1830: jpc_dequantize: Assertion `absstepsize >= 0' failed.
Aborted (core dumped)
---------------------------------------------------------------
CVE-2016-9398
https://github.com/asarubbo/poc/blob/master/00023-jasper-assert-jpc_floorlog2
$ imginfo -f 00023-jasper-assert-jpc_floorlog2
warning: ignoring invalid option max_samples
imginfo: jpc_math.c:94: jpc_floorlog2: Assertion `x > 0' failed.
Aborted (core dumped)

***************************************************************

Testing again against current jasper-2.0.23-1.mga7

CVE-2016-9397
$ imginfo -f 00010-jasper-assert-jpc_dequantize
invalid component bit depth 114
cannot get marker segment
error: cannot decode code stream
cannot load image
<and using the tweaked PoC>
$ file POC3
POC3: JPEG 2000 Part 1 (JP2)
$ imginfo -f POC3
error: no code stream found
cannot load image


CVE-2016-9398
$ imginfo -f 00023-jasper-assert-jpc_floorlog2
invalid component bit depth 128
cannot get marker segment
error: cannot decode code stream
cannot load image

These look like good results so I would say that the issue is fixed.
Have not changed the whiteboard.

CC: (none) => tarazed25

Comment 11 David Walser 2020-12-29 03:10:37 CET
Thank you Len!

Status comment: Need to test the PoC again, might already be fixed, also this maybe could be dropped => (none)
Status: NEW => RESOLVED
Resolution: (none) => FIXED
Version: Cauldron => 7
Whiteboard: MGA8TOO, MGA7TOO => (none)


Note You need to log in before you can comment on or make changes to this bug.