Out-of-bounds write in Squid - CVE-2019-12521

 

Out-of-bounds write in Squid - CVE-2019-12521

Published: May 11, 2020


Vulnerability identifier: #VU27667
CSH Severity: Medium
CVSS v4: 8.7 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2019-12521
CWE-ID: CWE-787
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to perform a denial of service (DoS) attack.

The vulnerability exists due to a boundary error when processing untrusted input. When Squid is parsing ESI, it keeps the ESI elements in ESIContext. ESIContext contains a buffer for holding a stack of ESIElements. When a new ESIElement is parsed, it is added via addStackElement. addStackElement has a check for the number of elements in this buffer, but it's off by 1, leading to a Heap Overflow of 1 element. The overflow is within the same structure so it can't affect adjacent memory blocks, and thus just leads to a crash while processing.


Affected software

Squid
Gentoo Linux
Amazon Linux AMI
Anolis OS
Red Hat Enterprise Linux for ARM 64
Red Hat Enterprise Linux for x86_64
Red Hat Enterprise Linux for IBM z Systems
Red Hat Enterprise Linux for Power, little endian
Opensuse
openEuler
squid (Debian package)
squid (Alpine package)
squid3 (Ubuntu package)
squid (Ubuntu package)
libecap
libecap-devel
squid
squid-debuginfo
squid-debugsource

How to mitigate CVE-2019-12521

Install updates from vendor's website.

Squid - addressed in versions 4.8, 5.0.2
squid (Debian package) - update to 4.6-1+deb10u2
squid3 (Ubuntu package) - addressed in versions 3.5.12-1ubuntu7.11, 3.5.27-1ubuntu1.6
squid (Ubuntu package) - addressed in versions 4.8-1ubuntu2.3, 4.10-1ubuntu1.1
libecap - update to 1.0.1-2
libecap-devel - update to 1.0.1-2
squid - update to 4.9-11
squid-debuginfo - update to 4.9-11
squid-debugsource - update to 4.9-11
squid - update to 4.11-4

External References

Related Security Bulletins