client-certificate-auth
Affected
- introduced
0.2.1, fixed1.0.0(semver)
Fixed versions
1.0.0
Fix
- Fixed version
1.0.0npm install [email protected]
Advisory
Also known as: CVE-2026-25651
client-certificate-auth Vulnerable to Open Redirect via Host Header Injection in HTTP-to-HTTPS redirect
Summary
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.
Vulnerable Code
// 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);
}
Attack Scenario
http://vulnerable-app.example.com/loginHost: attacker.com302 Found → https://attacker.com/loginImpact
Exploitability
Exploitation 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.
Fix
The vulnerable redirect behavior has been completely removed in version 1.0.0.
npm install client-certificate-auth@^1.0.0
Workarounds
If upgrading is not immediately possible:
x-forwarded-proto: httpsclientCertificateAuth to validate the Host header against an allowlistReferences
Medium Basis: The source's own band: MODERATE
0.2.1, fixed 1.0.0 (semver)1.0.0
1.0.0npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0