CVE-2018-25445 in Crypt::JWT
Summary
by MITRE • 11/25/2026
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.
decode_jwt runs the verify_iss, verify_sub, verify_aud and verify_jti checks only when the token carries the claim, and honours an option only as a Regexp or CODE reference. Any other value, such as verify_aud => 'myapp', is ignored.
An application that relies on these checks accepts a validly signed token meant for a different issuer, subject or audience.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/25/2026
The vulnerability identified in Crypt::JWT versions prior to 0.024 represents a critical flaw in the validation logic of JSON Web Tokens within Perl applications. This issue stems from an incorrect implementation of claim verification mechanisms that are essential for ensuring the integrity and authenticity of authenticated requests. Specifically, when developers configure verification options using plain string values rather than regular expressions or code references, the library fails to enforce checks for issuer, subject, audience, and JWT ID claims if those specific fields are absent from the token payload. This behavior deviates significantly from expected security practices where strict validation should occur regardless of whether optional-looking parameters are present in the incoming data structure.
The technical root cause lies within the decode_jwt function's handling of verification options. The library is designed to run verify_iss, verify_sub, verify_aud, and verify_jti checks only when the token explicitly carries the corresponding claim. Furthermore, it honors configuration values exclusively if they are provided as Regexp objects or CODE references. Any other data type, such a plain string like 'myapp' for audience verification, is effectively ignored by the validation routine. Consequently, an application configured with simple string-based expectations will not perform any substantive checks against these critical identity attributes during token decoding. This creates a scenario where the presence of a valid cryptographic signature becomes the sole determinant of trust, bypassing all semantic validations intended to restrict access based on contextual claims.
The operational impact of this vulnerability is severe for applications relying on JWTs for authentication and authorization. An attacker can exploit this flaw by crafting or obtaining a validly signed token that was originally issued for a different issuer, subject, audience, or with a distinct JWT ID. Because the verification logic skips these checks due to the misconfiguration or inherent library limitation regarding plain string options, the application will accept this malicious token as legitimate. This allows unauthorized access to protected resources, privilege escalation if the token contains elevated roles, and potential identity spoofing where an attacker impersonates another user or service by presenting a token intended for a different context but signed with a key known to the victim system.
This vulnerability aligns closely with CWE-287, which describes Improper Authentication, as well as CWE-613, Insufficient Session Expiration, in contexts where session tokens are misinterpreted due to weak validation rules. In terms of attack vectors, it facilitates exploitation similar to techniques found under MITRE ATT&CK Tactic TA0004 (Privilege Escalation) and specifically relates to token manipulation strategies often seen in web application attacks. The failure to validate audience or issuer claims is a common pattern exploited by attackers to bypass single sign-on implementations or microservice authentication boundaries, allowing lateral movement within an architecture that assumes JWTs are inherently trustworthy once the signature is verified.
To mitigate this risk, organizations must immediately upgrade Crypt::JWT to version 0.024 or later, where these validation checks have been corrected to properly enforce constraints regardless of claim presence when strict verification modes are enabled. For applications unable to update instantly, developers should audit their JWT handling code and ensure that all audience, issuer, subject, and ID verifications utilize Regexp objects or CODE references rather than plain strings. Additionally implementing a defense-in-depth strategy by validating token claims at the application layer before processing business logic provides an additional safeguard against such bypasses. Regular security audits of authentication libraries are essential to prevent similar oversights in future implementations.