CVE-2023-50269
📋 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
- Squid caching proxy
📦 What is this software?
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
Squid by Squid Cache
⚠️ 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.
🎯 Exploit Status
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
allDisable 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
allConfigure 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
- http://www.squid-cache.org/Versions/v5/SQUID-2023_10.patch
- http://www.squid-cache.org/Versions/v6/SQUID-2023_10.patch
- https://github.com/squid-cache/squid/security/advisories/GHSA-wgq4-4cfg-c4x3
- https://lists.debian.org/debian-lts-announce/2024/01/msg00003.html
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/A5QASTMCUSUEW3UOMKHZJB3FTONWSRXS/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MEV66D3PAAY6K7TWDT3WZBLCPLASFJDC/
- https://security.netapp.com/advisory/ntap-20240119-0005/
- http://www.squid-cache.org/Versions/v5/SQUID-2023_10.patch
- http://www.squid-cache.org/Versions/v6/SQUID-2023_10.patch
- https://github.com/squid-cache/squid/security/advisories/GHSA-wgq4-4cfg-c4x3
- https://lists.debian.org/debian-lts-announce/2024/01/msg00003.html
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/A5QASTMCUSUEW3UOMKHZJB3FTONWSRXS/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MEV66D3PAAY6K7TWDT3WZBLCPLASFJDC/
- https://security.netapp.com/advisory/ntap-20240119-0005/