Bug 1485287 - There are lots of memory leaks in JasPer which is trigged in function jas_strdup().
Summary: There are lots of memory leaks in JasPer which is trigged in function jas_str...
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: jasper
Version: 7.5-Alt
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Josef Ridky
QA Contact: Desktop QE
URL:
Whiteboard:
Keywords: Security
Depends On:
Blocks: CVE-2017-13748
TreeView+ depends on / blocked
 
Reported: 2017-08-25 09:31 UTC by owl337
Modified: 2018-08-01 23:32 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed:


Attachments (Terms of Use)
Triggered by "./imginfo -f POC9" (312 bytes, application/x-rar)
2017-08-25 09:31 UTC, owl337
no flags Details

Description owl337 2017-08-25 09:31:58 UTC
Created attachment 1318072 [details]
Triggered by  "./imginfo -f POC9"

Description of problem:

There are lots of memory leaks in JasPer which is trigged in function jas_strdup().

Version-Release number of selected component (if applicable):

<= latest version

How reproducible:

./imginfo -f POC9

Steps to Reproduce:

Description:

The gdb debugging information is listed below:
(gdb) set args POC9
(gdb) r 
warning: ignoring unknown marker segment (0xff76)
type = 0xff76 (UNKNOWN); len = 20;10 40 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 RCT requires all components have the same domain
error: cannot decode code stream
cannot load image

=================================================================
==104593==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16512 byte(s) in 86 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f40793576db  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e6db)

Direct leak of 184 byte(s) in 1 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f4079357353  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e353)
    #2 0x7f40793bd4d2  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xe44d2)

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f4079357353  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e353)

Indirect leak of 10922744 byte(s) in 15458 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f40793576db  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e6db)

Indirect leak of 905976 byte(s) in 10296 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f4079357353  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e353)

Indirect leak of 417584 byte(s) in 73 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f40793576db  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e6db)
    #2 0x7f40793bd4d2  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xe44d2)

Indirect leak of 246144 byte(s) in 34 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f40793576db  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e6db)
    #2 0x7f40793b005f  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xd705f)
    #3 0x7f40793bd4d2  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xe44d2)

Indirect leak of 246144 byte(s) in 34 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f40793576db  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e6db)
    #2 0x7f40793afff5  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xd6ff5)
    #3 0x7f40793bd4d2  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xe44d2)

Indirect leak of 816 byte(s) in 34 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f4079357353  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e353)
    #2 0x7f40793afff5  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xd6ff5)
    #3 0x7f40793bd4d2  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xe44d2)

Indirect leak of 816 byte(s) in 34 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f4079357353  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e353)
    #2 0x7f40793b005f  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xd705f)
    #3 0x7f40793bd4d2  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xe44d2)

Indirect leak of 48 byte(s) in 3 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f4079464228  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x18b228)
    #2 0x7f40793bd4d2  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xe44d2)

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x4b9278  (/home/icy/secreal/jasper/install_asan/bin/imginfo+0x4b9278)
    #1 0x7f4079357353  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0x7e353)
    #2 0x7f40793bd4d2  (/home/icy/secreal/jasper/install_asan/lib/libjasper.so.4+0xe44d2)

SUMMARY: AddressSanitizer: 12757032 byte(s) leaked in 26055 allocation(s).

Trigged in:
jas_strdup (s=0x7ffff7ba0600 <.str.1> "My Image Format (MIF)")
    at /home/icy/secreal/jasper/src/libjasper/base/jas_string.c:91
91		if (!(p = jas_malloc(n))) {
The programmer has applied for the memory but has not been released.


Actual results:

crash

Expected results:

crash

Additional info:


Credits:

Credits:

This vulnerability is detected by team OWL337, with our custom fuzzer collAFL. Please contact ganshuitao@gmail.com   and chaoz@tsinghua.edu.cn if you need more info about the team, the tool or the vulnerability.

Comment 2 Josef Ridky 2017-08-25 10:37:39 UTC
Thank you for taking the time to report this issue to us. We appreciate the feedback and use reports such as this one to guide our efforts at improving our products. That being said, this bug tracking system is not a mechanism for requesting support, and we are not able to guarantee the timeliness or suitability of a resolution.

If this issue is critical or in any way time sensitive, please raise a ticket through the regular Red Hat support channels to ensure it receives the proper attention and prioritization to assure a timely resolution. 

For information on how to contact the Red Hat production support team, please visit:
    https://www.redhat.com/support/process/production/#howto

For proper identification of issue are required properly filled following information:

- Description of problem
- Version-Release number of selected component (if applicable)
- Steps to Reproduce
- Actual results
- Expected results
- Additional info

Comment 3 Tomas Hoger 2017-12-07 14:43:30 UTC
jas_strdup() is red herring and irrelevant, see upstream bug for more info:

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


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