CVE-2023-50269

8.6 HIGH

📋 TL;DR

Squid caching proxy versions 2.6 through 6.5 contain an uncontrolled recursion vulnerability in HTTP request parsing when the follow_x_forwarded_for feature is enabled. Remote attackers can cause denial of service by sending specially crafted X-Forwarded-For headers, potentially crashing the Squid service. This affects all systems running vulnerable Squid versions with the vulnerable configuration enabled.

💻 Affected Systems

Products:
  • Squid caching proxy
Versions: 2.6 through 2.7.STABLE9, 3.1 through 5.9, 6.0.1 through 6.5
Operating Systems: All operating systems running Squid
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when follow_x_forwarded_for feature is configured and enabled. Default configurations may not be vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service outage where Squid crashes and becomes unavailable, disrupting all web proxy traffic for dependent systems and users.

🟠

Likely Case

Service degradation or temporary unavailability requiring manual restart of Squid processes, causing intermittent connectivity issues for users.

🟢

If Mitigated

Minimal impact with proper rate limiting, header size restrictions, and monitoring in place to detect and block attack attempts.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending HTTP requests with malicious X-Forwarded-For headers to vulnerable Squid instances.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.6

Vendor Advisory: https://github.com/squid-cache/squid/security/advisories/GHSA-wgq4-4cfg-c4x3

Restart Required: Yes

Instructions:

1. Upgrade to Squid version 6.6 or later. 2. Apply vendor patches for stable releases if upgrading is not possible. 3. Restart Squid service after patching.

🔧 Temporary Workarounds

Disable follow_x_forwarded_for

all

Disable the vulnerable feature if not required for functionality

Edit squid.conf and set 'follow_x_forwarded_for deny all' or remove related configurations

Limit header size

all

Configure maximum request header size to restrict malicious payloads

Add 'request_header_max_size 64 KB' to squid.conf (adjust size as needed)

🧯 If You Can't Patch

  • Implement network-level filtering to block or limit X-Forwarded-For headers exceeding reasonable size
  • Deploy WAF or reverse proxy in front of Squid to sanitize and validate incoming headers

🔍 How to Verify

Check if Vulnerable:

Check Squid version with 'squid -v' and verify if follow_x_forwarded_for is enabled in squid.conf

Check Version:

squid -v | head -1

Verify Fix Applied:

Confirm Squid version is 6.6 or later, or verify applied patches, then test with crafted X-Forwarded-For headers

📡 Detection & Monitoring

Log Indicators:

  • Multiple requests with unusually large X-Forwarded-For headers
  • Squid process crashes or restarts
  • High CPU/memory usage spikes

Network Indicators:

  • HTTP requests containing X-Forwarded-For headers exceeding normal size (e.g., >1KB)
  • Increased error responses from Squid

SIEM Query:

source="squid" AND ("X-Forwarded-For" AND content_length>1024) OR "segmentation fault" OR "crash"

🔗 References

📤 Share & Export