Bug 1435324 (CVE-2017-6851) - CVE-2017-6851 jasper: Invalid memory read in jas_matrix_bindsub (jas_seq.c)
Summary: CVE-2017-6851 jasper: Invalid memory read in jas_matrix_bindsub (jas_seq.c)
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2017-6851
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1434464 1434465 1434467
Blocks: 1449402
TreeView+ depends on / blocked
 
Reported: 2017-03-23 14:28 UTC by Andrej Nemec
Modified: 2022-02-22 20:26 UTC (History)
15 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-10-21 11:52:27 UTC
Embargoed:


Attachments (Terms of Use)

Description Andrej Nemec 2017-03-23 14:28:23 UTC
The jas_matrix_bindsub function in jas_seq.c in JasPer allows attackers to cause a denial of service (invalid read) via a crafted image.

References:

https://blogs.gentoo.org/ago/2017/01/25/jasper-invalid-memory-read-in-jas_matrix_bindsub-jas_seq-c/
http://www.openwall.com/lists/oss-security/2017/01/25/9

Upstream bug:

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

Comment 1 Andrej Nemec 2017-03-23 14:30:59 UTC
Created jasper tracking bugs for this issue:

Affects: fedora-all [bug 1434464]

Comment 2 Andrej Nemec 2017-03-23 14:32:07 UTC
Created mingw-jasper tracking bugs for this issue:

Affects: epel-7 [bug 1434465]

Comment 3 Andrej Nemec 2017-03-23 14:33:49 UTC
Created mingw-jasper tracking bugs for this issue:

Affects: fedora-all [bug 1434467]

Comment 4 Tomas Hoger 2017-03-31 19:45:22 UTC
Original reporter's advisory:

https://blogs.gentoo.org/ago/2017/01/25/jasper-invalid-memory-read-in-jas_matrix_bindsub-jas_seq-c/

Relevant information from the advisory:

Another round of fuzzing shows that a crafted image causes an invalid memory read.

The complete ASan output:

# imginfo -f $FILE
warning: ignoring unknown marker segment (0xff59)
type = 0xff59 (UNKNOWN); len = 20;00 40 40 00 00 00 00 69 00 00 00 00 00 00 00 00 00 00 warning: ignoring unknown marker segment (0xff46)
type = 0xff46 (UNKNOWN); len = 20;01 40 40 00 00 00 00 00 00 00 00 00 00 00 12 00 94 7f ASAN:DEADLYSIGNAL
=================================================================
==22653==ERROR: AddressSanitizer: SEGV on unknown address 0x60180000ec30 (pc 0x7f410df421b7 bp 0x7ffdc80abaf0 sp 0x7ffdc80aba60 T0)
==22653==The signal is caused by a READ memory access.
    #0 0x7f410df421b6 in jas_matrix_bindsub /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/libjasper/base/jas_seq.c:254:18
    #1 0x7f410df951a1 in jpc_dec_tileinit /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/libjasper/jpc/jpc_dec.c:835:5
    #2 0x7f410df951a1 in jpc_dec_process_sod /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/libjasper/jpc/jpc_dec.c:594
    #3 0x7f410dfa1853 in jpc_dec_decode /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/libjasper/jpc/jpc_dec.c:425:10
    #4 0x7f410dfa1853 in jpc_decode /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/libjasper/jpc/jpc_dec.c:262
    #5 0x7f410df71231 in jp2_decode /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/libjasper/jp2/jp2_dec.c:218:21
    #6 0x7f410df33214 in jas_image_decode /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/libjasper/base/jas_image.c:444:16
    #7 0x50a3be in main /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/appl/imginfo.c:238:16
    #8 0x7f410d01378f in __libc_start_main /tmp/portage/sys-libs/glibc-2.23-r3/work/glibc-2.23/csu/../csu/libc-start.c:289
    #9 0x419cd8 in _start (/usr/bin/imginfo+0x419cd8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /tmp/portage/media-libs/jasper-2.0.10/work/jasper-2.0.10/src/libjasper/base/jas_seq.c:254:18 in jas_matrix_bindsub
==22653==ABORTING

Affected version: 2.0.10

Fixed version: N/A

Commit fix: N/A

Credit: This bug was discovered by Agostino Sarubbo of Gentoo.

CVE: CVE-2017-6851

Reproducer:
https://github.com/asarubbo/poc/blob/master/00125-jasper-invalidread-jas_matrix_bindsub

Comment 5 Tomas Hoger 2017-03-31 19:47:17 UTC
This issue has not been fixed upstream yet and affects the latest released version 2.0.12.  The first version which which this can be reproducer is 1.900.25.


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