---
title: "CVE-2016-5766\n    | Ubuntu"
description: Ubuntu is an open source software operating system that runs from the
  desktop, to the cloud, to all your internet connected things.
url: https://ubuntu.com/security/CVE-2016-5766?format=md
keywords: index, follow
---

# CVE-2016-5766

Publication date 24 June 2016

Last updated 25 August 2025

---

Ubuntu priority

**Medium**

[Why this priority?](https://ubuntu.com/security/cves/about#priority )

## Cvss 3 Severity Score

**8.8 · High**

[Score breakdown](https://ubuntu.com/security/CVE-2016-5766?format=md#impact-score)

Toggle side navigation

## 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.

[Read the notes from the security team](https://ubuntu.com/security/CVE-2016-5766?format=md#notes)

## Status

Show unmaintained releases

| Package | Ubuntu Release | Status |
| --- | --- | --- |
| libgd2 | 16.04 LTS xenial | Fixed 2.1.1-4ubuntu0.16.04.2 |
| 15.10 wily | Fixed 2.1.1-4ubuntu0.15.10.2 |
| 14.04 LTS trusty | Fixed 2.1.0-3ubuntu0.2 |
| 12.04 LTS precise | Fixed 2.0.36~rc1~dfsg-6ubuntu2.2 |
| php5 | 16.04 LTS xenial | Not in release |
| 15.10 wily | Not affected |
| 14.04 LTS trusty | Not affected |
| 12.04 LTS precise | Not affected |
| php7.0 | 16.04 LTS xenial | Not affected |
| 15.10 wily | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |

---

* [How can I get the fixes?](https://ubuntu.com/security/cves/about#security)
* [What do statuses mean?](https://ubuntu.com/security/cves/about#statuses)
* [Patch details](https://ubuntu.com/security/CVE-2016-5766?format=md#patch-details)

## Notes

---

### [mdeslaur](https://launchpad.net/~mdeslaur)

php uses the system libgd2

---

### [sbeattie](https://launchpad.net/~sbeattie)

PEAR issues should go against php-pear as of xenial

### Patch details

For informational purposes only. We recommend not to cherry-pick updates. [How can I get the fixes?](https://ubuntu.com/security/cves/about#security)

| Package | Patch details |
| --- | --- |
| libgd2 | * Upstream:   [aba3db8](https://github.com/libgd/libgd/commit/aba3db8ba159465ecec1089027a24835a6da9cc0) * Upstream:   [a6a0e7f](https://github.com/libgd/libgd/commit/a6a0e7feabb2a9738086a5dc96348f233c87fa79) |
| php7.0 | * Upstream:   <http://git.php.net/?p=php-src.git;a=commit;h=7722455726bec8c53458a32851d2a87982cf0eac> |

## Severity score breakdown

CVSS version:
CVSS v3.0

**Base score**

8.8 · High

* Base metrics

  | Parameter | Value |
  | --- | --- |
  | Attack vector | Network |
  | Attack complexity | Low |
  | Privileges required | None |
  | User interaction | Required |
  | Scope | Unchanged |
  | Confidentiality impact | High |
  | Integrity impact | High |
  | Availability impact | High |
* Scores

  | Parameter | Value |
  | --- | --- |
  | Base score | 8.8 · High |
  | Exploitability score | - |
  | Impact score | - |

**Vector:** CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

## References

* [MITRE](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5766)
* [NVD](https://nvd.nist.gov/vuln/detail/CVE-2016-5766)
* [Launchpad](https://launchpad.net/bugs/cve/CVE-2016-5766)
* [Debian](https://security-tracker.debian.org/tracker/CVE-2016-5766)

### Related Ubuntu Security Notices (USN)

+ [USN-3030-1](https://usn.ubuntu.com/USN-3030-1)
+ GD library vulnerabilities
+ 11 July 2016

### Other references

* <https://www.cve.org/CVERecord?id=CVE-2016-5766>
