CVE-2013-7456
High · 7.6CVSS
7.6
EPSS
3.8%
Published
Aug 7, 2016
CISA due date
—
Cloudanix analysis
A flaw in the software that resizes pictures can let attackers crash websites or steal data from systems that process images uploaded by users.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Out-of-bounds read in gd_interpolation.c imagescale implementation triggers memory corruption, enabling denial of service or unspecified further impact when processing a malicious image.
Why it matters to the business
Applications that resize user-supplied images may crash or behave unexpectedly, causing service outages, support overhead, and potential exposure of sensitive memory contents to remote attackers.
How an attack unfolds
An attacker crafts a specially malformed image that triggers the flawed interpolation path, then causes a vulnerable PHP application to call imagescale on the image, resulting in an out-of-bounds read that can crash the process or allow further manipulation.
How to fix it
Upgrade libgd to version 2.1.1 or later and PHP to 5.5.36 or later, 5.6.22 or later, or 7.0.7 or later. Disable image scaling of untrusted input until patches are applied.
How to confirm the fix worked
Verify installed libgd and PHP versions against the fixed releases, then test image processing endpoints with known-good and boundary images to confirm absence of crashes or abnormal behavior.
Typical attack path
- Locate a PHP application that accepts and resizes images using the imagescale function
- Prepare a crafted image file designed to exercise the vulnerable code path in libgd
- Submit the image to the application via upload, URL fetch, or API endpoint
- Trigger the imagescale call and observe denial of service or memory disclosure
How to detect it
Review web server and PHP error logs for segmentation faults or out-of-bounds access messages during image processing; correlate spikes in image upload activity with process restarts or memory errors.
What your security team should do
- Prioritize patching PHP and libgd installations that handle user-provided images
- Implement input validation and size limits on all image upload paths
- Monitor application logs and process health for image-processing crashes
- Consider sandboxing or isolating image manipulation workloads
The record
gd_interpolation.c in the GD Graphics Library (aka libgd) before 2.1.1, as used in PHP before 5.5.36, 5.6.x before 5.6.22, and 7.x before 7.0.7, allows remote attackers to cause a denial of service (out-of-bounds read) or possibly have unspecified other impact via a crafted image that is mishandled by the imagescale function.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | libgd2 | 0 | 2.1.1-1 |
| Debian:12 | libgd2 | 0 | 2.1.1-1 |
| Debian:13 | libgd2 | 0 | 2.1.1-1 |
| Debian:14 | libgd2 | 0 | 2.1.1-1 |
| Debian:8 | libgd2 | 0 | 2.1.0-5+deb8u3 |
| Debian:8 | php5 | 0 | 5.6.22+dfsg-0+deb8u1 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56 | 0 | 0:2.3-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-bcmath | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-cli | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-common | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-dba | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-dbg | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-debuginfo | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-devel | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-embedded | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-enchant | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-fpm | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-gd | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-gmp | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-imap | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-intl | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-ldap | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-mbstring | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-mysqlnd | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-odbc | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-opcache | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-pdo | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-pear | 0 | 1:1.9.5-4.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-pgsql | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-process | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-pspell | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-recode | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-snmp | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-soap | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-tidy | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-xml | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-xmlrpc | 0 | 0:5.6.25-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-runtime | 0 | 0:2.3-1.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-scldevel | 0 | 0:2.3-1.el6 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56 | 0 | 0:2.3-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-bcmath | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-cli | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-common | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-dba | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-dbg | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-debuginfo | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-devel | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-embedded | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-enchant | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-fpm | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-gd | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-gmp | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-intl | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-ldap | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-mbstring | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-mysqlnd | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-odbc | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-opcache | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-pdo | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-pear | 0 | 1:1.9.5-4.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-pgsql | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-process | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-pspell | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-recode | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-snmp | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-soap | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-xml | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-xmlrpc | 0 | 0:5.6.25-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-runtime | 0 | 0:2.3-1.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-scldevel | 0 | 0:2.3-1.el7 |
| SUSE:Linux Enterprise Desktop 12 | imap | 0 | 2007e_suse-19.1 |
| SUSE:Linux Enterprise Desktop 12 SP1 | imap | 0 | 2007e_suse-19.1 |
| SUSE:Linux Enterprise Module for Web and Scripting 12 | imap | 0 | 2007e_suse-19.1 |
| SUSE:Linux Enterprise Module for Web and Scripting 12 | php5 | 0 | 5.5.14-64.5 |
| SUSE:Linux Enterprise Software Development Kit 12 | imap | 0 | 2007e_suse-19.1 |
| SUSE:Linux Enterprise Software Development Kit 12 | php5 | 0 | 5.5.14-64.5 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | imap | 0 | 2007e_suse-19.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | php5 | 0 | 5.5.14-64.5 |
| SUSE:Linux Enterprise Workstation Extension 12 | imap | 0 | 2007e_suse-19.1 |
| SUSE:Linux Enterprise Workstation Extension 12 SP1 | imap | 0 | 2007e_suse-19.1 |
| Ubuntu:14.04:LTS | libgd2 | 0 | 2.1.0-3ubuntu0.2 |
| Ubuntu:16.04:LTS | libgd2 | 0 | 2.1.1-4ubuntu0.16.04.2 |
Related vulnerabilities
- CVE-2017-6362 Double free vulnerability in the gdImagePngPtr function in libgd2 before 2.2.5 allows… Also affects libgd2
- CVE-2017-7890 The GIF decoding function gdImageCreateFromGifCtx in gd_gif_in.c in the GD Graphics… Also affects libgd2
- CVE-2016-10166 Integer underflow in the _gdContributionsAlloc function in gd_interpolation.c in the GD… Also affects libgd2
- CVE-2016-6911 The dynamicGetbuf function in the GD Graphics Library (aka libgd) before 2.2.4 allows… Also affects libgd2
- CVE-2016-6132 The gdImageCreateFromTgaCtx function in the GD Graphics Library (aka libgd) before 2.2.3… Also affects libgd2
- CVE-2016-3074 Integer signedness error in GD Graphics Library 2.1.1 (aka libgd or libgd2) allows remote… Also affects libgd2
- CVE-2014-9709 The GetCode_ function in gd_gif_in.c in GD 2.1.1 and earlier, as used in PHP before… Also affects libgd2
- CVE-2014-2497 The gdImageCreateFromXpm function in gdxpm.c in libgd, as used in PHP 5.4.26 and earlier… Also affects libgd2