Input validation error in Squid - CVE-2019-12520
Published: May 11, 2020 / Updated: August 6, 2025
Vulnerability details
The vulnerability allows a remote attacker to perform cache poisoning.
The vulnerability exists due to insufficient validation of user-supplied input within ESI. When receiving a request, Squid checks its cache to see if it can serve up a response. It does this by making a MD5 hash of the absolute URL of the request. If found, it servers the request. The absolute URL can include the decoded UserInfo (username and password) for certain protocols. This decoded info is prepended to the domain. This allows an attacker to provide a username that has special characters to delimit the domain, and treat the rest of the URL as a path or query string. An attacker could first make a request to their domain using an encoded username, then when a request for the target domain comes in that decodes to the exact URL, it will serve the attacker's HTML instead of the real HTML. On Squid servers that also act as reverse proxies, this allows an attacker to gain access to features that only reverse proxies can use, such as ESI.
Affected software
squid (Debian package)
libecap
libecap-devel
squid (Ubuntu package)
squid
Red Hat Enterprise Linux for x86_64
Anolis OS
Red Hat Enterprise Linux for ARM 64
Red Hat Enterprise Linux for Power, little endian
Red Hat Enterprise Linux for IBM z Systems
Ubuntu
How to mitigate CVE-2019-12520
squid (Debian package) - update to 4.6-1+deb10u2
libecap - update to 1.0.1-2
libecap-devel - update to 1.0.1-2
squid (Ubuntu package) - addressed in versions 3.5.12-1ubuntu7.12, 3.5.12-1ubuntu7.13, 3.5.27-1ubuntu1.7, 3.5.27-1ubuntu1.8
squid - update to 4.11-4