{"id":"CVE-2026-25651","aliases":["GHSA-m4w9-gch5-c2g4"],"url":"https://o3.security/vulnerability/CVE-2026-25651","summary":"client-certificate-auth has an Open Redirect via Host Header Injection in HTTP-to-HTTPS redirect","details":"### Summary\n\nVersions 0.2.1 and 0.3.0 of `client-certificate-auth` contain an open redirect vulnerability. The middleware unconditionally redirects HTTP requests to HTTPS using the unvalidated `Host` header, allowing an attacker to redirect users to arbitrary domains.\n\n### Vulnerable Code\n\n```javascript\n// lib/clientCertificateAuth.js (versions 0.2.1, 0.3.0)\nif (!req.secure && req.header('x-forwarded-proto') != 'https') {\n  return res.redirect('https://' + req.header('host') + req.url);\n}\n```\n\n### Attack Scenario\n\n1. Attacker crafts a link: `http://vulnerable-app.example.com/login`\n2. When victim clicks, attacker intercepts and injects header: `Host: attacker.com`\n3. Server responds: `302 Found → https://attacker.com/login`\n4. Victim is redirected to attacker-controlled site\n\n### Impact\n\n- **Phishing**: Attackers can use trusted domain links to redirect victims to credential-harvesting pages\n- **OAuth/SSO Token Theft**: In authentication flows, authorization codes or tokens may leak via redirect\n- **Referer Leakage**: Sensitive URL parameters may be exposed to attacker domains via the Referer header\n- **Cache Poisoning**: In deployments with shared caches, malicious redirects may be cached and served to other users\n\n### Exploitability\n\nExploitation requires that HTTP traffic reaches the Node.js application without TLS termination setting `x-forwarded-proto: https`. This condition is uncommon in production deployments behind modern reverse proxies or load balancers, which limits real-world exploitability.\n\n### Fix\n\nThe vulnerable redirect behavior has been completely removed in version 1.0.0.\n\n```bash\nnpm install client-certificate-auth@^1.0.0\n```\n\n### Workarounds\n\nIf upgrading is not immediately possible:\n\n1. Block HTTP traffic at the network/load balancer level\n2. Ensure your reverse proxy always sets `x-forwarded-proto: https`\n3. Add middleware before `clientCertificateAuth` to validate the `Host` header against an allowlist\n\n### References\n\n- [CWE-601: URL Redirection to Untrusted Site](https://cwe.mitre.org/data/definitions/601.html)\n- [OWASP: Unvalidated Redirects and Forwards](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html)\n- [Fix Commit](https://github.com/tgies/client-certificate-auth/commit/8fc995e953db483495be46862965e50fe9e1cc52)","published":"2026-02-06T18:50:26.046Z","modified":"2026-08-12T03:51:32.651824920Z","cvss":{"score":6.1,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"client-certificate-auth","fixedVersion":"1.0.0"}],"fix":{"url":"https://github.com/tgies/client-certificate-auth/commit/8fc995e953db483495be46862965e50fe9e1cc52","label":"tgies/client-certificate-auth@8fc995e"},"references":[{"type":"WEB","url":"https://github.com/tgies/client-certificate-auth/releases/tag/v1.0.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/25xxx/CVE-2026-25651.json"},{"type":"ADVISORY","url":"https://github.com/tgies/client-certificate-auth/security/advisories/GHSA-m4w9-gch5-c2g4"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25651"},{"type":"WEB","url":"https://github.com/tgies/client-certificate-auth/commit/8fc995e953db483495be46862965e50fe9e1cc52"},{"type":"PACKAGE","url":"https://github.com/tgies/client-certificate-auth"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:32.651824920Z"}}