CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Bypass Vulnerabilities in Squid and McAfee Web Access Gateway

About two weeks ago, a Brazilian security researcher by the name of Gabriel Menezes Nunes released two URL filter bypass vulnerabilities for both Squid 3.1.9 and McAfee Web Gateway 7.0 (CVE-2012-2213 and CVE-2012-2212 respectively). At a high level, these vulnerabilities suggested that an unauthenticated user could successfully bypass URL restrictions and access unauthorized sites.

When these vulnerabilities were initially released, the community met them with quite a bit of skepticism. Although the technique for actually exploiting the vulnerability was pretty straight forward, many (including myself) were having difficulty replicating a Squid configuration that demonstrated this vulnerability.

After reaching out to Gabriel for the context in which he found the vulnerability and after a couple emails back and forth, I was able to get a working configuration that emulated the vulnerability as he noted in his original release. A configuration scenario, which demonstrates this, is a proxy that allows access to only sub-domains of google.com via SSL, but prohibits access to anything else.

Configuring Squid with the following three directives achieves the desired effect:

11469_bab93a30-8dd1-4afd-a446-c07a696f6c48

Once these rules are implemented, a remote user, configured to use this proxy, could only access sub-domains of google.com via HTTPS. All other sites would be restricted.

Taking a closer look at what happens behind the scenes in a normal scenario, when a user goes to an authorized site, we would see something like this:

8559_2f10c5b1-1d5f-412f-a066-6ef971b79d20

When the user goes to an unauthorized site, we would see something like this:

10458_8a25a42d-08b9-43cd-a3b2-a9977170ad3c

However, what Gabriel discovered in his research was that you can bypass filter restrictions like this by simply forging the host header to be that of a white-listed domain like so:

10606_919f6245-16b9-4a75-b3ef-609dcd526fd3

Gabriel also provided a python script in his release, which acts as an intermediate proxy, which will make the necessary adjustments to the Host header on the fly to make browsing of restricted sites seamless to a prospective user. I am sure there is room for some sort of "yo dawg" exhibit meme here, but I have also confirmed that his proxy tool, when used with the above-mentioned configuration, works as expected to bypass filter controls.

At the time of this writing, both vulnerabilities (Squid and McAfee Web Gateway) are listed as "***DISPUTED***" in the National Vulnerability Database (NVD). This generally means that the community and/or the vendor have not been able to confirm the vulnerability and that it is still under review. Based on my testing, I consider this vulnerability to have real impact, but as a matter of classification it seems to me more a configuration/implementation vulnerability than a Squid vulnerability. However, with that said, that does not preclude other vendors that deploy Squid as a subsystem in their solution from using the above-mentioned conventions as a form of CONNECT-based access control.

It is important to note here that in testing, I was not successful in getting my hands on a McAfee Web Gateway 7.0 to validate CVE-2012-2212. However, after performing successful testing on Squid, I can say that if McAfee were to use a configuration as I describe above, it is certainly plausible that the implementation is affected in a similar fashion.

In testing this vulnerability, I also wrote a little ruby-based proxy scanner to help speed the evaluation process up. Here is a preview of the output when running it on a proxy Squid instance configured as mentioned above:

8740_37a783c5-2978-4469-a698-76b714ddc35e

I have made this code available on GitHub (project link here) for anyone who would like to download the code and evaluate proxies for these configuration vulnerabilities. I would be interested, but not necessarily surprised, if it helps discover additional proxies that are vulnerable to the bypass condition identified by Gabriel.

Lastly, I'd like to point out how the "CONNECT" verb is essentially a method of obtaining an unobstructed TCP proxy to a desired location and is available on most proxy server implementations for proxying SSL traffic. Although this functionality in many cases is desired for functionality purposes, it can be and is often used for malicious purposes such as propagating malware, data exfiltration, port scanning, DMZ traversal and many more. Perhaps in a future blog post I will share one or more of these techniques in greater depth.

Latest SpiderLabs Blogs

EDR – The Multi-Tool of Security Defenses

This is Part 8 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

The Invisible Battleground: Essentials of EASM

Know your enemy – inside and out. External Attack Surface Management tools are an effective way to understand externally facing threats and help plan cyber defenses accordingly. Let’s discuss what...

Read More

Fake Dialog Boxes to Make Malware More Convincing

Let’s explore how SpiderLabs created and incorporated user prompts, specifically Windows dialog boxes into its malware loader to make it more convincing to phishing targets during a Red Team...

Read More