Critical Authentication Bypass in Example Auth Library
Affected: example-auth-lib 2.0.0 - 2.3.4
Overview
A critical vulnerability exists in example-auth-lib versions 2.0.0 through 2.3.4 that allows an unauthenticated attacker to bypass authentication by forging session tokens. The root cause is improper validation of JWT signature algorithms, allowing an attacker to specify none as the algorithm.
Affected Versions
| Version Range | Status |
|---|---|
| 2.0.0 - 2.3.4 | Vulnerable |
| 2.3.5+ | Patched |
| 1.x | Not affected |
Risk Summary
An attacker can craft a JWT with "alg": "none" in the header, bypassing signature verification entirely. This grants unauthorized access to any authenticated endpoint without valid credentials.
CVSS 3.1 Score: 9.8 (Critical)
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Detection
Check if your project uses example-auth-lib in the vulnerable version range:
npm list example-auth-lib
# or
grep "example-auth-lib" package-lock.json
Review your authentication middleware for explicit algorithm enforcement.
Remediation
- Upgrade immediately to version 2.3.5 or later
- Enforce algorithm allowlist in your JWT verification configuration
- Rotate all active sessions after patching
// Ensure algorithm is explicitly specified
const decoded = verify(token, secret, { algorithms: ['HS256'] });
CodeGRC Advisory Notes
This vulnerability pattern (algorithm confusion in JWT libraries) is a recurring class of issue. During CodeGRC audits, we specifically test for algorithm enforcement as part of our OWASP ASVS V3 (Session Management) verification. Teams should ensure their authentication libraries explicitly specify allowed algorithms rather than relying on the token header.