| Package | Affected versions | Patched versions |
|---|---|---|
| client-certificate-auth | ≥ 0.2.1, < 1.0.0 | 1.0.0 |
| client-certificate-auth | ≥ 0.2.1, < 1.0.0 | 1.0.0 |
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.
// lib/clientCertificateAuth.js (versions 0.2.1, 0.3.0)
if (!req.secure && req.header('x-forwarded-proto') != 'https') {
return res.redirect('https://' + req.header('host') + req.url);
}
http://vulnerable-app.example.com/loginHost: attacker.com302 Found → https://attacker.com/loginExploitation 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.
The vulnerable redirect behavior has been completely removed in version 1.0.0.
npm install client-certificate-auth@^1.0.0
If upgrading is not immediately possible:
x-forwarded-proto: httpsclientCertificateAuth to validate the Host header against an allowlistRunning one of these products? Scan your site to see whether it exposes a vulnerable version.
Scan my site free