Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1173162 - (CVE-2014-8138) CVE-2014-8138 jasper: heap overflow in jp2_decode() (oCERT-2014-012)
CVE-2014-8138 jasper: heap overflow in jp2_decode() (oCERT-2014-012)
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Red Hat Product Security
impact=important,public=20141218,repo...
: Security
Depends On: 1173566 1173567 1173568 1173569 1175761 1175762 1175763 1175764 1185246 1185247 1188087
Blocks: 1167538 1206715
  Show dependency treegraph
 
Reported: 2014-12-11 10:02 EST by Tomas Hoger
Modified: 2016-11-23 16:43 EST (History)
19 users (show)

See Also:
Fixed In Version: jasper 1.900.2
Doc Type: Bug Fix
Doc Text:
A heap-based buffer overflow flaw was found in the way JasPer decoded JPEG 2000 image files. A specially crafted file could cause an application using JasPer to crash or, possibly, execute arbitrary code.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-18 09:25:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch (682 bytes, patch)
2014-12-11 10:17 EST, Tomas Hoger
jpopelka: review+
Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Novell 909475 None None None Never
Red Hat Product Errata RHSA-2014:2021 normal SHIPPED_LIVE Important: jasper security update 2014-12-18 18:31:00 EST
Red Hat Product Errata RHSA-2015:0698 normal SHIPPED_LIVE Important: rhevm-spice-client security, bug fix, and enhancement update 2015-03-18 12:11:47 EDT
Red Hat Product Errata RHSA-2015:1713 normal SHIPPED_LIVE Important: rhev-hypervisor security, bug fix, and enhancement update 2015-09-03 17:08:30 EDT

  None (edit)
Description Tomas Hoger 2014-12-11 10:02:27 EST
oCERT reports a heap-overflow issue in jp2_decode() in jasper:

  This code in jas_decode doesn't check for an upper bound on the value of
  channo:

	jas_image_setcmpttype(dec->image,
	  dec->chantocmptlut[dec->cdef->data.cdef.ents[i].channo],
	  jp2_getct(jas_image_clrspc(dec->image),
	  dec->cdef->data.cdef.ents[i].type, dec->cdef->data.cdef.ents[i].assoc));
  
  This could be used via jas_image_setcmpttype (actually this is just
  image->cmpts_[cmptno]->type_ = type), to do an arbitrary write since
  there's no bound check there either.

Acknowledgements:

Red Hat would like to thank oCERT for reporting these issues. oCERT acknowledges Jose Duart of the Google Security Team as the original reporter.
Comment 2 Tomas Hoger 2014-12-11 10:17:56 EST
Created attachment 967280 [details]
Proposed patch

This adds channo check directly to jp2_decode().  An alternative would be to do check earlier in jp2_cdef_getdata().  However, as jp2_decode() does other similar sanity checks, it seems more consistent to add the check there as well.
Comment 3 Jiri Popelka 2014-12-11 11:09:16 EST
Comment on attachment 967280 [details]
Proposed patch

Patch looks good to me.
Comment 7 Tomas Hoger 2014-12-18 09:16:11 EST
Public now via oCERT-2014-012 advisory.

External References:

http://www.ocert.org/advisories/ocert-2014-012.html
Comment 8 Tomas Hoger 2014-12-18 09:17:44 EST
Created mingw-jasper tracking bugs for this issue:

Affects: fedora-all [bug 1175762]
Affects: epel-7 [bug 1175764]
Comment 9 Tomas Hoger 2014-12-18 09:17:48 EST
Created jasper tracking bugs for this issue:

Affects: fedora-all [bug 1175761]
Affects: epel-5 [bug 1175763]
Comment 11 errata-xmlrpc 2014-12-18 13:31:49 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7
  Red Hat Enterprise Linux 6

Via RHSA-2014:2021 https://rhn.redhat.com/errata/RHSA-2014-2021.html
Comment 12 Fedora Update System 2014-12-29 04:55:05 EST
mingw-jasper-1.900.1-25.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 13 Fedora Update System 2014-12-29 04:55:17 EST
mingw-jasper-1.900.1-25.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 14 Fedora Update System 2014-12-29 05:01:52 EST
mingw-jasper-1.900.1-25.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 15 Fedora Update System 2015-01-02 19:13:16 EST
mingw-jasper-1.900.1-25.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 16 Fedora Update System 2015-01-06 01:04:39 EST
jasper-1.900.1-27.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 17 Fedora Update System 2015-01-06 01:07:18 EST
jasper-1.900.1-26.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 18 Fedora Update System 2015-01-06 01:10:30 EST
jasper-1.900.1-29.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 21 errata-xmlrpc 2015-03-18 08:12:43 EDT
This issue has been addressed in the following products:

  RHEV Manager version 3.5

Via RHSA-2015:0698 https://rhn.redhat.com/errata/RHSA-2015-0698.html
Comment 22 Fedora Update System 2015-05-10 20:52:30 EDT
jasper-1.900.1-15.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 23 errata-xmlrpc 2015-09-03 13:08:54 EDT
This issue has been addressed in the following products:

  RHEV-H and Agents for RHEL-6
  RHEV-H and Agents for RHEL-7

Via RHSA-2015:1713 https://rhn.redhat.com/errata/RHSA-2015-1713.html
Comment 24 Tomas Hoger 2016-11-23 16:43:46 EST
Fix was integrated upstream in version 1.900.2:

https://github.com/mdadams/jasper/commit/c54113d6fa49f8f26d1572e972b806276c5b05d5

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