gd: Integer overflow in _gd2GetHeader() resulting in heap overflow
Published Aug 7, 2016
8.8
HIGHCVSS 3.0
EPSS 7.50%
Description
Integer overflow in the _gd2GetHeader function in gd_gd2.c in the GD Graphics Library (aka libgd) before 2.2.3, as used in PHP before 5.5.37, 5.6.x before 5.6.23, and 7.x before 7.0.8, allows remote attackers to cause a denial of service (heap-based buffer overflow and application crash) or possibly have unspecified other impact via crafted chunk dimensions in an image.
Affected products
No data.
Configuration 3
- 6.0
Configuration 5
- 5
Configuration 6
Running on/with
- ≤ 5.5.36
- 5.6.0
- 5.6.0
- 5.6.0
- 5.6.0
- 5.6.0
- 5.6.0
- 5.6.0
- 5.6.0
- 5.6.0
- 5.6.1
- 5.6.2
- 5.6.3
- 5.6.4
- 5.6.5
- 5.6.6
- 5.6.7
- 5.6.8
- 5.6.9
- 5.6.10
- 5.6.11
- 5.6.12
- 5.6.13
- 5.6.14
- 5.6.15
- 5.6.16
- 5.6.17
- 5.6.18
- 5.6.19
- 5.6.20
- 5.6.21
- 5.6.22
- 7.0.0
- 7.0.1
- 7.0.2
- 7.0.3
- 7.0.4
- 7.0.5
- 7.0.6
- 7.0.7
Configuration 8
- 23
Configuration 9
- 8.0
Configuration 11
- 24
Configuration 18
- 22
Configuration 20
- 7.0
No data.
Red Hat Enterprise Linux 7
gd-0:2.0.35-27.el7_9
Fixed · RHSA-2020:5443
Red Hat Enterprise Linux 7
php-0:5.4.16-42.el7
Fixed · RHSA-2016:2598
Red Hat Software Collections for Red Hat Enterprise Linux 6
rh-php56-0:2.3-1.el6
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 6
rh-php56-php-0:5.6.25-1.el6
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 6
rh-php56-php-pear-1:1.9.5-4.el6
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
rh-php56-0:2.3-1.el6
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
rh-php56-php-0:5.6.25-1.el6
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
rh-php56-php-pear-1:1.9.5-4.el6
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7
rh-php56-0:2.3-1.el7
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7
rh-php56-php-0:5.6.25-1.el7
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7
rh-php56-php-pear-1:1.9.5-4.el7
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
rh-php56-0:2.3-1.el7
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
rh-php56-php-0:5.6.25-1.el7
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
rh-php56-php-pear-1:1.9.5-4.el7
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS
rh-php56-0:2.3-1.el7
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS
rh-php56-php-0:5.6.25-1.el7
Fixed · RHSA-2016:2750
Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS
rh-php56-php-pear-1:1.9.5-4.el7
Fixed · RHSA-2016:2750
Red Hat Enterprise Linux 5
gd
Will not fix
Red Hat Enterprise Linux 5
php
Will not fix
Red Hat Enterprise Linux 5
php53
Will not fix
Red Hat Enterprise Linux 6
gd
Will not fix
Red Hat Enterprise Linux 6
php
Will not fix
Red Hat Enterprise Linux 8
gd
Not affected
Red Hat OpenShift Enterprise 2
gd
Affected
Red Hat Software Collections
php54-php
Will not fix
Red Hat Software Collections
php55-php
Will not fix
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 7 | gd-0:2.0.35-27.el7_9 | Fixed | RHSA-2020:5443 |
| Red Hat Enterprise Linux 7 | php-0:5.4.16-42.el7 | Fixed | RHSA-2016:2598 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6 | rh-php56-0:2.3-1.el6 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6 | rh-php56-php-0:5.6.25-1.el6 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6 | rh-php56-php-pear-1:1.9.5-4.el6 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS | rh-php56-0:2.3-1.el6 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS | rh-php56-php-0:5.6.25-1.el6 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS | rh-php56-php-pear-1:1.9.5-4.el6 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | rh-php56-0:2.3-1.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | rh-php56-php-0:5.6.25-1.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | rh-php56-php-pear-1:1.9.5-4.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS | rh-php56-0:2.3-1.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS | rh-php56-php-0:5.6.25-1.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS | rh-php56-php-pear-1:1.9.5-4.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS | rh-php56-0:2.3-1.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS | rh-php56-php-0:5.6.25-1.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS | rh-php56-php-pear-1:1.9.5-4.el7 | Fixed | RHSA-2016:2750 |
| Red Hat Enterprise Linux 5 | gd | Will not fix | n/a |
| Red Hat Enterprise Linux 5 | php | Will not fix | n/a |
| Red Hat Enterprise Linux 5 | php53 | Will not fix | n/a |
| Red Hat Enterprise Linux 6 | gd | Will not fix | n/a |
| Red Hat Enterprise Linux 6 | php | Will not fix | n/a |
| Red Hat Enterprise Linux 8 | gd | Not affected | n/a |
| Red Hat OpenShift Enterprise 2 | gd | Affected | n/a |
| Red Hat Software Collections | php54-php | Will not fix | n/a |
| Red Hat Software Collections | php55-php | Will not fix | n/a |
No package ranges for this CVE.
Remediation
No remediation recorded yet.
Metrics
No CVSS v4.0 score for this CVE.
No CVSS v3.1 score for this CVE.
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
1 other source (Red Hat) ▾
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
AV:N/AC:M/Au:N/C:P/I:P/A:P
This CVE is not in the KEV list.
No CISA SSVC assessment for this CVE yet.
Estimated probability of exploitation in the wild in the next 30 days (FIRST EPSS). As of Oct 1, 2026.
Score over time
2022–2026- EPSS v2
- EPSS v3
- EPSS v4
- EPSS v5
Percentile over time
- EPSS v2
- EPSS v3
- EPSS v4
- EPSS v5
Table of values (31 key points)
Flat stretches are collapsed; showing up to 120 newest points.
| Date | Score | Percentile | Model |
|---|---|---|---|
| Oct 1, 2026 | 7.50% (0.07495) | 94.30th | v5 (v2026.06.15) |
| Jun 15, 2026 | 7.56% (0.07556) | 93.72th | v5 (v2026.06.15) |
| Jun 5, 2026 | 18.31% (0.18313) | 95.34th | v4 (v2025.03.14) |
| Feb 18, 2026 | 16.59% (0.16592) | 94.76th | v4 (v2025.03.14) |
| Dec 28, 2025 | 15.27% (0.15273) | 94.40th | v4 (v2025.03.14) |
| Dec 27, 2025 | 4.81% (0.04805) | 89.19th | v4 (v2025.03.14) |
| Oct 28, 2025 | 15.27% (0.15273) | 94.31th | v4 (v2025.03.14) |
| Oct 27, 2025 | 4.81% (0.04805) | 89.02th | v4 (v2025.03.14) |
| Oct 1, 2025 | 15.27% (0.15273) | 94.41th | v4 (v2025.03.14) |
| Jul 30, 2025 | 4.59% (0.04587) | 88.81th | v4 (v2025.03.14) |
| Jul 12, 2025 | 14.67% (0.14671) | 94.15th | v4 (v2025.03.14) |
| Jun 19, 2025 | 17.59% (0.17588) | 94.74th | v4 (v2025.03.14) |
| May 30, 2025 | 14.29% (0.14286) | 94.02th | v4 (v2025.03.14) |
| Apr 13, 2025 | 16.18% (0.16177) | 94.27th | v4 (v2025.03.14) |
| Apr 12, 2025 | 14.29% (0.14286) | 93.82th | v4 (v2025.03.14) |
| Mar 30, 2025 | 15.52% (0.15518) | 94.10th | v4 (v2025.03.14) |
| Mar 29, 2025 | 27.02% (0.27020) | 94.19th | v4 (v2025.03.14) |
| Mar 17, 2025 | 15.52% (0.15518) | 94.17th | v4 (v2025.03.14) |
| Dec 17, 2024 | 11.45% (0.11452) | 95.20th | v3 (v2023.03.01) |
| Mar 25, 2024 | 24.24% (0.24242) | 96.50th | v3 (v2023.03.01) |
| Feb 20, 2024 | 22.84% (0.22836) | 96.37th | v3 (v2023.03.01) |
| Jan 18, 2024 | 19.81% (0.19810) | 95.88th | v3 (v2023.03.01) |
| Dec 15, 2023 | 19.90% (0.19901) | 95.85th | v3 (v2023.03.01) |
| Nov 8, 2023 | 24.58% (0.24576) | 96.15th | v3 (v2023.03.01) |
| Aug 20, 2023 | 25.04% (0.25036) | 96.06th | v3 (v2023.03.01) |
| Jul 11, 2023 | 28.48% (0.28475) | 96.25th | v3 (v2023.03.01) |
| May 29, 2023 | 29.00% (0.28996) | 96.24th | v3 (v2023.03.01) |
| Mar 7, 2023 | 29.69% (0.29692) | 96.19th | v3 (v2023.03.01) |
| Mar 6, 2023 | 3.41% (0.03407) | 84.65th | v2 (v2022.01.01) |
| Apr 1, 2022 | 3.41% (0.03407) | 83.10th | v2 (v2022.01.01) |
| Feb 4, 2022 | 3.41% (0.03407) | 66.20th | v2 (v2022.01.01) |
References (19)
- http://github.com/php/php-src/commit/7722455726bec8c53458a32851d2a87982cf0eac?w=1 x_refsource_CONFIRMExploitPatch
- http://lists.opensuse.org/opensuse-security-announce/2016-07/msg00004.html vendor-advisoryx_refsource_SUSE
- http://lists.opensuse.org/opensuse-security-announce/2016-08/msg00025.html vendor-advisoryx_refsource_SUSE
- http://lists.opensuse.org/opensuse-updates/2016-08/msg00003.html vendor-advisoryx_refsource_SUSE
- http://php.net/ChangeLog-5.php x_refsource_CONFIRMRelease Notes
- http://php.net/ChangeLog-7.php x_refsource_CONFIRMRelease Notes
- http://rhn.redhat.com/errata/RHSA-2016-2598.html vendor-advisoryx_refsource_REDHAT
- http://rhn.redhat.com/errata/RHSA-2016-2750.html vendor-advisoryx_refsource_REDHAT
- http://www.debian.org/security/2016/dsa-3619 vendor-advisoryx_refsource_DEBIANThird Party Advisory
- http://www.openwall.com/lists/oss-security/2016/06/23/4 mailing-listx_refsource_MLISTRelease Notes
- http://www.ubuntu.com/usn/USN-3030-1 vendor-advisoryx_refsource_UBUNTU
- https://access.redhat.com/security/cve/CVE-2016-5766 Vendor Advisory
- https://bugs.php.net/bug.php?id=72339 x_refsource_CONFIRMExploitPatchVendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=1351068 Issue Tracking
- https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05240731 x_refsource_CONFIRM
- https://libgd.github.io/release-2.2.3.html x_refsource_CONFIRMRelease Notes
- https://nvd.nist.gov/vuln/detail/CVE-2016-5766
- https://security.gentoo.org/glsa/201612-09 vendor-advisoryx_refsource_GENTOO
- https://www.cve.org/CVERecord?id=CVE-2016-5766
Change history (0)
No recorded changes yet.