nearform fast-jwt
cpe:2.3:a:nearform:fast-jwt:*:*:*:*:node.js:*:*
- >= 0.0.1, < 6.1.0
A critical vulnerability exists in fast-jwt versions 0.0.1 prior to 6.1.0, allowing for cache collisions that can misidentify JSON Web Tokens (JWTs) during verification. This issue arises when a custom cacheKeyBuilder method fails to create unique keys for different tokens, leading to valid tokens incorrectly returning claims from others. As a result, users may be misidentified as other users based on the wrong token, potentially allowing for user impersonation, privilege escalation, cross-tenant data access, and authorization bypass.
Exploitation of this vulnerability causes a logical authorization flaw by creating confusion between identities and their associated claims. This mix-up can lead to user impersonation, where one user gains access to another's identity and permissions, and privilege escalation, allowing low-privilege users to inherit admin-level access. Additionally, it can cause cross-tenant data access, where users access resources from other tenants, and bypass security decisions based on incorrect user identities.
To reproduce this vulnerability, create a verifier with caching enabled and a custom cacheKeyBuilder that generates identical keys for different tokens. When this verifier processes tokens that should be distinct, it will return claims from one token for the other, demonstrating the cache collision and resulting identity confusion.
To address this vulnerability, ensure that custom cacheKeyBuilder methods generate unique keys for each token. Alternatively, remove the custom cacheKeyBuilder and disable caching altogether.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.