{"id":"CVE-2026-25651","aliases":["CVE-2026-25651","GHSA-m4w9-gch5-c2g4"],"related":[],"kind":"vulnerability","state":"published","title":"client-certificate-auth has an Open Redirect via Host Header Injection in HTTP-to-HTTPS redirect","summary":"client-certificate-auth is middleware for Node.js implementing client SSL certificate authentication/authorization. Versions 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. This vulnerability is fixed in 1.0.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"client-certificate-auth is middleware for Node.js implementing client SSL certificate authentication/authorization. Versions 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. This vulnerability is fixed in 1.0.0.","source":"cvelist"},{"lang":"en","text":"### 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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"client-certificate-auth es un middleware para Node.js que implementa autenticación/autorización de certificados SSL de cliente. Las versiones 0.2.1 y 0.3.0 de client-certificate-auth contienen una vulnerabilidad de redirección abierta. El middleware redirige incondicionalmente las solicitudes HTTP a HTTPS utilizando el encabezado Host no validado, permitiendo a un atacante redirigir a los usuarios a dominios arbitrarios. Esta vulnerabilidad está corregida en 1.0.0.","source":"nvd"}],"published":"2026-02-06T18:50:26.046Z","modified":"2026-06-17T10:25:01.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-601"],"affected":[{"ranges":[{"version":">= 0.2.1, < 1.0.0","status":"affected"}],"vendor":"tgies","product":"client-certificate-auth","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.2.1","status":"affected","fixed":"1.0.0"}],"ecosystem":"npm","package":"client-certificate-auth","purl":"pkg:npm/client-certificate-auth","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"0.2.1","fixed":"1.0.0"}],"vendor":"tgies","product":"client-certificate-auth","cpe":"cpe:2.3:a:tgies:client-certificate-auth:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/tgies/client-certificate-auth/security/advisories/GHSA-m4w9-gch5-c2g4","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/tgies/client-certificate-auth/releases/tag/v1.0.0","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25651","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/tgies/client-certificate-auth/commit/8fc995e953db483495be46862965e50fe9e1cc52","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tgies/client-certificate-auth","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-02-09T15:19:32.286Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25651","url":"https://www.cve.org/CVERecord?id=CVE-2026-25651","licence":"CVE Terms of Use","modified":"2026-02-09T15:28:48.992Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m4w9-gch5-c2g4","url":"https://github.com/advisories/GHSA-m4w9-gch5-c2g4","licence":"CC-BY-4.0","modified":"2026-02-06T22:22:03.562Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25651","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25651","licence":"Public domain","modified":"2026-06-17T10:25:01.167Z"}],"updatedAt":"2026-11-25T22:59:13.567Z","epss":{"score":0.00183,"percentile":0.08271,"date":"2026-12-01T12:00:22.000Z"}}