CVE-2018-25445: Crypt::JWT versions before 0.024 for Perl skip issuer, subject, audience and JWT ID checks when the claim is absent or the option is a plain string
Crypt::JWT versions before 0.024 for Perl skip issuer, subject, audience and JWT ID checks when the claim is absent or the option is a plain string.
decodejwt runs the verifyiss, verifysub, verifyaud and verifyjti checks only when the token carries the claim, and honours an option only as a Regexp or CODE reference. Any other value, such as verifyaud => 'myapp', is ignored.
An application that relies on these checks accepts a validly signed token meant for a different issuer, subject or audience.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.024
Event History
Frequently Asked Questions
Which applications are exposed to token confusion or cross-issuer acceptance?
Applications using Crypt::JWT before 0.024 are exposed if they rely on decode_jwt to enforce issuer, subject, audience, or JWT ID restrictions. The risk is especially relevant where tokens from multiple issuers, audiences, or application contexts can be presented to the same verifier.
What must an attacker have for exploitation?
An attacker needs a validly signed JWT that the application will otherwise accept cryptographically, but that was issued for a different issuer, subject, audience, or token context. The bypass concerns claim validation rather than signature verification.
Are string-based verification settings effective in affected versions?
No. In affected versions, options such as verify_aud => 'myapp' are ignored because the option is honored only when supplied as a Regexp or CODE reference.
How can I determine whether my application is affected?
Check whether it uses Crypt::JWT before 0.024 and passes plain strings to verify_iss, verify_sub, verify_aud, or verify_jti. It is also affected when it expects these checks to reject tokens with missing corresponding claims, because decode_jwt performs the checks only when the token includes the claim.