Squid Proxy Sensitive Header Leak via Error Page `mailto:` Diagnostic Block (CVE-2025-62168)
by krakhen.dev (nehkark) · 2026-07-06
- Severity
- Critical
- CVE
- CVE-2025-62168
- Category
- network
- Affected product
- Squid Proxy
- Affected versions
- Versions < 7.2 potentially affected; behavior confirmed on Squid 5.x, 6.x, 7.1
- Disclosed
- 2026-07-06
- Patch status
- unpatched
Tags
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-06 |
| Last Updated | 2026-07 |
| Author / Researcher | krakhen.dev (nehkark) |
| CVE / Advisory | CVE-2025-62168 |
| Category | network |
| Severity | Critical |
| CVSS Score | 10.0 (NVD; the source repository proposes a lower vector scoring 7.5 — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) |
| Status | PoC |
| Tags | squid, proxy, information-disclosure, header-reflection, jwt, token-leak, error-page, cwe-209, cwe-550 |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Squid Proxy |
| Versions Affected | Versions < 7.2 potentially affected; behavior confirmed on Squid 5.x, 6.x, 7.1 |
| Language / Platform | Squid (C++ proxy server); PoC written in Python (asyncio/aiohttp) |
| Authentication Required | No (any client able to route requests through the proxy) |
| Network Access Required | Yes (client must be able to send HTTP requests through the vulnerable Squid instance) |
Summary
When Squid is configured with email_err_data enabled (including in default configurations), it embeds diagnostic details about a failed request — including the original client’s HTTP request headers — into the auto-generated error page it returns. Specifically, the error template builds a mailto: link (intended for contacting the proxy administrator) whose body contains a URL-encoded dump of the original HTTP Request: block, line by line. Squid does not sufficiently sanitize or strip custom/sensitive headers from this block before embedding them, so any attacker-supplied header — including Authorization bearer tokens, JWTs, API keys, or other credential-bearing headers forwarded by legitimate clients through the proxy — can be reflected back verbatim inside the error page’s mailto: link and read directly from the HTTP response body.
Vulnerability Details
Root Cause
- Squid includes request metadata (including arbitrary request headers) in its
ERR_*error templates when generating diagnostic error pages. - The header sanitization applied to this diagnostic block is incomplete — it does not strip custom or sensitive headers.
- The offending headers end up embedded, URL-encoded, inside the
mailto:hyperlink’s body parameter in the returned error HTML. - Any client that can trigger an error response from the proxy (e.g., a request to a non-resolving/non-existent host) can read back its own (or, in shared/forwarding proxy scenarios, another party’s forwarded) headers directly from the response.
- Classified as CWE-209 (Generation of Error Message Containing Sensitive Information) and CWE-550 (Server-Generated Error Message Containing Sensitive Information).
Attack Vector
- Attacker sends an HTTP request through the target Squid proxy, including a sensitive header (e.g., a JWT
Authorization/custom bearer-token header) and targeting a URL designed to fail (e.g., a non-resolving hostname), forcing Squid to generate anERR_READ_ERROR-style error page. - Squid’s error-page template embeds the full original
HTTP Request:block — including the sensitive header verbatim — inside amailto:webmaster?...&body=...link in the returned error HTML. - The PoC script (
cve-2025-62168.py) parses the returned HTML for the<a href="mailto:...">tag, URL-decodes the body (translating%0D%0A,%3A,%20sequences back to newlines/colons/spaces), and extracts the injected header’s value line by line. - The extracted value (in the PoC, a demo JWT) is then decoded (header/payload/signature) to demonstrate that a real bearer token would be fully recoverable by an attacker with only proxy access — no authentication to the proxy itself is required.
Impact
An attacker able to route even a single request through an affected Squid instance can recover sensitive headers — including bearer tokens, JWTs, API keys, or other credential material — that were present in requests passing through the proxy, simply by forcing an error response and reading Squid’s own diagnostic output. In environments where Squid operates as a reverse proxy, forward proxy, or load balancer in front of authenticated internal services, this can lead to credential/session theft, impersonation of legitimate users, and lateral movement into backend systems.
Environment / Lab Setup
Target: Squid Proxy (5.x, 6.x, or 7.1) with `email_err_data` enabled (default in many configurations)
Attacker: Python 3 host with network access to the proxy, using cve-2025-62168.py (requires aiohttp, beautifulsoup4 — see requirements.txt)
Proof of Concept
PoC Script
See
cve-2025-62168.pyin this folder (supporting files:payload.json,token.txt,example.txt,requirements.txt).
| |
The script:
- Connects to the specified Squid proxy.
- Sends a request (to a deliberately non-resolving host,
http://nonexistent.krakhen-test.local/) carrying a controlledX-Test-Leakheader containing a demo JWT. - Forces Squid to generate an error page (
ERR_READ_ERROR). - Parses the returned HTML for the
mailto:diagnostic block. - Extracts the leaked
X-Test-Leakheader value from the decoded block. - Decodes the recovered JWT (header, payload, signature) to prove full recovery of the injected token — see
example.txtin this folder for a full sample run/output, andtoken.txtfor the manual OpenSSL commands used to construct the demo JWT frompayload.json.
Detection & Indicators of Compromise
Signs of compromise:
- Squid access/error logs showing repeated requests to non-resolving or intentionally-erroring hostnames from a single client, consistent with an attacker forcing error-page generation
- Presence of
email_err_data oninsquid.confon internet- or multi-tenant-facing proxies - Outbound/response traffic containing
mailto:links whose bodies include recognizable token/credential formats (e.g.,eyJ...JWT prefixes)
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade Squid to 7.2 or later, where this header-reflection issue is addressed |
| Interim mitigation | Set email_err_data off in squid.conf (explicitly called out by the researcher as the key mitigation); disable/strip unnecessary custom headers at the proxy edge; prevent clients from sending arbitrary Authorization-like headers through the proxy; audit ERR_* error templates for leaked metadata |
References
Notes
Mirrored from https://github.com/nehkark/CVE-2025-62168 on 2026-07-06.
| |