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 1536552 - (CVE-2018-5727) CVE-2018-5727 openjpeg: integer overflow in opj_t1_encode_cblks in src/lib/openjp2/t1.c
CVE-2018-5727 openjpeg: integer overflow in opj_t1_encode_cblks in src/lib/op...
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
impact=low,public=20180113,reported=2...
: Security
Depends On: 1536553 1536554 1538467
Blocks: 1536559
  Show dependency treegraph
 
Reported: 2018-01-19 11:05 EST by Laura Pardo
Modified: 2018-01-25 02:18 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Laura Pardo 2018-01-19 11:05:29 EST
A flaw was found in OpenJPEG 2.3.0, there is an integer overflow vulnerability in the opj_t1_encode_cblks function in openjp2/t1.c file. Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file. 

References:
https://github.com/uclouvain/openjpeg/issues/1053
Comment 1 Laura Pardo 2018-01-19 11:06:01 EST
Created openjpeg tracking bugs for this issue:

Affects: epel-all [bug 1536554]
Affects: fedora-all [bug 1536553]
Comment 2 Huzaifa S. Sidhpurwala 2018-01-25 00:36:22 EST
Analysis:

I was able to reproduce this by using openjpeg compiled with -fsanitize=undefined. The following error message is displayed when the binary aborts:

[huzaifas@babylon bin]$ ./opj_compress -n 1 -i /tmp/openjpeg_2-3_opj_compress_integer-overflow_opj_t1_encode_cblks.bmp -o /tmp/null.j2k

[INFO] tile number 1 / 1
/NotBackedUp/oss/openjpeg/src/lib/openjp2/t1.c:2173:55: runtime error: signed integer overflow: 322385710 * 64 cannot be represented in type 'int'
[ERROR] opj_t2_encode_packet(): only 22 bytes remaining in output buffer. 359 needed.
[ERROR] Cannot encode tile
failed to encode image: opj_encode
failed to encode image: opj_end_compress
failed to encode image

which points to:

2173                     tiledp[tileIndex] *= (1 << T1_NMSEDEC_FRACBITS);

tiledp is an array of ints and the above operation causes an overflow. However it seems that insufficient data is caught correctly by following code and an ERROR message is displayed. The binary does not crash but seems to abort elegantly. 

So its likely that the only result of the flaw is that the image file is not rendered/converted by openjpeg.

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