Bug 1905201 (CVE-2020-27828) - CVE-2020-27828 jasper: Heap-based buffer overflow in cp_create() in jpc_enc.c
Summary: CVE-2020-27828 jasper: Heap-based buffer overflow in cp_create() in jpc_enc.c
Keywords:
Status: NEW
Alias: CVE-2020-27828
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1905692 1905693 1905202 1905203 1910574
Blocks: 1903611
TreeView+ depends on / blocked
 
Reported: 2020-12-07 17:41 UTC by Guilherme de Almeida Suckevicz
Modified: 2021-02-16 18:46 UTC (History)
7 users (show)

Fixed In Version: jasper 2.0.23
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Jasper tool’s jpc encoder. This flaw allows an attacker to craft input provided to Jasper, causing an arbitrary out-of-bounds write. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Guilherme de Almeida Suckevicz 2020-12-07 17:41:11 UTC
Heap buffer overflow to out of bounds write in the jpc encoder's cp_create() routine when resolution levels are greater than max.

Reference:
https://github.com/jasper-software/jasper/issues/252

Upstream patch:
https://github.com/jasper-software/jasper/pull/253

Comment 1 Guilherme de Almeida Suckevicz 2020-12-07 17:41:36 UTC
Created jasper tracking bugs for this issue:

Affects: fedora-all [bug 1905202]


Created mingw-jasper tracking bugs for this issue:

Affects: fedora-all [bug 1905203]

Comment 2 Todd Cullum 2020-12-07 23:26:00 UTC
Flaw summary:

It's possible that an image processed by jasper along with crafted rlvl input could set resolution levels above max, which could cause a heap buffer overflow in the loop near `tccp->prcwidthexpns[rlvlno] = prcwidthexpn;` in the `cp_create()` routine of /src/libjasper/jpc/jpc_enc.c. Because `prcwidthexpn` and `prcheightexpn` can also be controlled by data obtained from the crafted input, it leaves potential for exploitation surrounding arbitrary writes.

Comment 3 Todd Cullum 2020-12-08 00:37:04 UTC
The above flaw is mostly caused by improper input validation where the provided rlvl value is trusted by default.

Comment 10 Todd Cullum 2020-12-08 21:36:38 UTC
Acknowledgments:

Name: zodf0055980

Comment 11 RaTasha Tillery-Smith 2020-12-15 15:41:24 UTC
Mitigation:

This flaw can be mitigated for the Jasper tool by not accepting untrusted inputs to be processed by Jasper or constraining rlevels on those inputs from outside of Jasper.


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