Ubuntu update for GD

Published: 2019-02-28 | Updated: 2019-03-28
Severity High
Patch available YES
Number of vulnerabilities 2
CVE ID CVE-2019-6977
CVE-2019-6978
CWE ID CWE-787
CWE-415
Exploitation vector Network
Public exploit Public exploit code for vulnerability #1 is available.
Public exploit code for vulnerability #2 is available.
Vulnerable software libgd2 (Ubuntu package) Subscribe
Vendor Canonical Ltd.

Security Advisory

1) Out-of-bounds write

Severity: High

CVSSv3: 9 [CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C] [PCI]

CVE-ID: CVE-2019-6977

CWE-ID: CWE-787 - Out-of-bounds Write

Description

The vulnerability allows a remote attacker to execute arbitrary on the target system.

The weakness exists due to out-of-bounds write in imagecolormatch. A remote attacker can write up to 1200 bytes over the boundaries of a buffer allocated in the imagecolormatch function, which then calls gdImageColorMatch() and execute arbitrary code with elevated privileges.

Mitigation

Update the affected packages.

Ubuntu 18.10
libgd-tools - 2.2.5-4ubuntu1.1
libgd3 - 2.2.5-4ubuntu1.1
Ubuntu 18.04 LTS
libgd-tools - 2.2.5-4ubuntu0.3
libgd3 - 2.2.5-4ubuntu0.3
Ubuntu 16.04 LTS
libgd-tools - 2.1.1-4ubuntu0.16.04.11
libgd3 - 2.1.1-4ubuntu0.16.04.11
Ubuntu 14.04 LTS
libgd-tools - 2.1.0-3ubuntu0.11
libgd3 - 2.1.0-3ubuntu0.11

Vulnerable software versions

libgd2 (Ubuntu package): 2.1.0-3ubuntu0.1, 2.1.0-3ubuntu0.2, 2.1.0-3ubuntu0.3, 2.1.0-3ubuntu0.5, 2.1.0-3ubuntu0.6, 2.1.0-3ubuntu0.7, 2.1.0-3ubuntu0.8, 2.1.0-3ubuntu0.10, 2.1.1-4ubuntu0.16.04.1, 2.1.1-4ubuntu0.16.04.2, 2.1.1-4ubuntu0.16.04.3, 2.1.1-4ubuntu0.16.04.5, 2.1.1-4ubuntu0.16.04.6, 2.1.1-4ubuntu0.16.04.7, 2.1.1-4ubuntu0.16.04.8, 2.1.1-4ubuntu0.16.04.10, 2.2.5-4ubuntu0.2

CPE External links

https://usn.ubuntu.com/3900-1/

Q & A

Can this vulnerability be exploited remotely?

Yes. This vulnerability can be exploited by a remote non-authenticated attacker via the Internet.

Is there known malware, which exploits this vulnerability?

No. We are not aware of malware exploiting this vulnerability. However, proof of concept for this vulnerability is available.

2) Double Free

Severity: High

CVSSv3: 8.6 [CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C] [PCI]

CVE-ID: CVE-2019-6978

CWE-ID: CWE-415 - Double Free

Description

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists due to double free in the gdImage*Ptr() functions in gd_gif_out.c, gd_jpeg.c, and gd_wbmp.c. A remote attacker can trick the victim into opening a specially crafted input, trigger double free error and execute arbitrary code on the target system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.

Mitigation

Update the affected packages.

Ubuntu 18.10
libgd-tools - 2.2.5-4ubuntu1.1
libgd3 - 2.2.5-4ubuntu1.1
Ubuntu 18.04 LTS
libgd-tools - 2.2.5-4ubuntu0.3
libgd3 - 2.2.5-4ubuntu0.3
Ubuntu 16.04 LTS
libgd-tools - 2.1.1-4ubuntu0.16.04.11
libgd3 - 2.1.1-4ubuntu0.16.04.11
Ubuntu 14.04 LTS
libgd-tools - 2.1.0-3ubuntu0.11
libgd3 - 2.1.0-3ubuntu0.11

Vulnerable software versions

libgd2 (Ubuntu package): 2.1.0-3ubuntu0.1, 2.1.0-3ubuntu0.2, 2.1.0-3ubuntu0.3, 2.1.0-3ubuntu0.5, 2.1.0-3ubuntu0.6, 2.1.0-3ubuntu0.7, 2.1.0-3ubuntu0.8, 2.1.0-3ubuntu0.10, 2.1.1-4ubuntu0.16.04.1, 2.1.1-4ubuntu0.16.04.2, 2.1.1-4ubuntu0.16.04.3, 2.1.1-4ubuntu0.16.04.5, 2.1.1-4ubuntu0.16.04.6, 2.1.1-4ubuntu0.16.04.7, 2.1.1-4ubuntu0.16.04.8, 2.1.1-4ubuntu0.16.04.10, 2.2.5-4ubuntu0.2

CPE External links

https://usn.ubuntu.com/3900-1/

Q & A

Can this vulnerability be exploited remotely?

Yes. This vulnerability can be exploited by a remote non-authenticated attacker via the Internet.

Is there known malware, which exploits this vulnerability?

No. We are not aware of malware exploiting this vulnerability. However, proof of concept for this vulnerability is available.