CVE-2015-5221: Use After Free

Published Aug 21, 2015
·
Updated

A use-after-free which leads to double-free vulnerability was found in Jasper JPEG-2000 library, in src/libjasper/mif/mifcod.c file.

553 case MIFHSAMP: 554 cmpt->sampperx = atoi(jastvparsergetval(tvp)); 555 break; 556 case MIFVSAMP: 557 cmpt->samppery = atoi(jastvparsergetval(tvp)); 558 break;

572 jastvparserdestroy(tvp); 573 if (!cmpt->sampperx || !cmpt->samppery) { 574 goto error; 575 } 576 if (mifhdraddcmpt(hdr, hdr->numcmpts, cmpt)) { 577 goto error; 578 } 579 return 0; 580 581 error: 582 if (cmpt) { 583 mifcmptdestroy(cmpt); 584 } 585 if (tvp) { 586 jastvparserdestroy(tvp); 587 } 588 return -1;

Both tvp and tvp->buf are freed by jastvparserdestroy(tvp), but if one of the two following branch conditions is taken, a second call to jastvparserdestroy(tvp) occurs. It is a use-after-free because before calling free in jastvparserdestroy there is a check to tvp->buf, while tvp could have been freed. Two double free take place just after this check (on tvp->buf and tvp).

Public via:

http://seclists.org/oss-sec/2015/q3/408

Acknowledgements:

Name: Josselin Feist

Other sources

Use-after-free vulnerability in the mifprocesscmpt function in libjasper/mif/mifcod.c in the JasPer JPEG-2000 library before 1.900.2 allows remote attackers to cause a denial of service (crash) via a crafted JPEG 2000 image file.

Launchpad

Affected Software

10 affected componentsFixes available
debian/jasper
redhat/jasper<1.900.2
1.900.2
Fedoraproject Fedora=23
Fedoraproject Fedora=24
Fedoraproject Fedora=25
openSUSE Leap=42.2
openSUSE openSUSE=13.1
openSUSE openSUSE=13.2
Opensuse Project Leap=42.1
Jasper Project Jasper<=1.900.1

Event History

Jul 25, 2017
CVE Published
via MITRE·06:00 PM
Data Sourced
via MITRE·06:00 PM
Description
Data Sourced
via NVD·06:29 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·10:08 PM
Description
Sep 14, 2024
Data Sourced
via Ubuntu·03:56 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2015-5221?

CVE-2015-5221 has a moderate severity rating due to the potential for a use-after-free condition leading to a double-free vulnerability.

2

How do I fix CVE-2015-5221?

To fix CVE-2015-5221, update the Jasper library to version 1.900.2 or later.

3

What software is affected by CVE-2015-5221?

CVE-2015-5221 affects the Jasper JPEG-2000 library found in multiple distributions including Debian, Fedora, and openSUSE.

4

What vulnerability type is CVE-2015-5221?

CVE-2015-5221 is classified as a use-after-free vulnerability.

5

Can CVE-2015-5221 lead to code execution?

Yes, CVE-2015-5221 could potentially allow attackers to execute arbitrary code due to memory corruption.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203