Some versions of the Squid web proxy cache server built with Basic Authentication features are affected by a heap buffer overflow vulnerability.
The heap buffer overflow security flaw, tracked as CVE-2019-12527, could be exploited by attackers to trigger DoS condition and also to execute arbitrary code on the vulnerable servers.
The flaw received a high severity CVSS v3.0 base score of 8.8 by, an attacker could be exploited by sending a specially crafted request to any targeted server.
The flaw affects Squid 4.0.23 through 4.7, the root couse is the incorrect buffer management. When checking Basic Authentication with HttpHeader::getAuth, the proxy cache server stores the decoded data in aglobal buffer. The problem is that Squid does not check that the decoded length isn’t greater than the buffer, triggering a heap-based buffer overflow.
“Due to incorrect buffer management Squid is vulnerable to a heap overflow and possible remote code execution attack when processing HTTP Authentication credentials.” reads the security advisory.
“This allows a malicious client to write a substantial amount of arbitrary data to the heap. Potentially gaining ability to execute arbitrary code. On systems with memory access protections this can result in the Squid process being terminated unexpectedly. Resulting in a denial of service for all clients using the proxy. This issue is limited to traffic accessing the Squid Cache Manager reports or using the FTP protocol gateway.”
Squid team pointed out that the problem is limited to the traffic accessing the Cache Manager reports or using the FTP protocol gateway.
Squid development team addressed the flaw with the release of Squid 4.8 on July 9.
The security advisory recommends the following workarounds for servers that can’t be patched:
Deny ftp:// protocol URLs being proxied and Cache Manager report access to all clients:
acl FTP proto FTP http_access deny FTP http_access deny manager
Build Squid with --disable-auth-basic
An interesting technical analysis of the vulnerability was published by Trend Micro on the website of the Zero-day initiative.
Pierluigi Paganini is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group and Cyber G7 Group, he is also a Security Evangelist, Security Analyst and Freelance Writer.
Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US.
Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines.
Author of the Books "The Deep Dark Web" and “Digital Virtual Currency and Bitcoin”.