CVE-2026-138378 in react-native-pure-jwt
Summary
by MITRE • 11/29/2026
react-native-pure-jwt before 3.1.1 on Android contains a signature verification bypass vulnerability that allows unauthenticated attackers to forge tokens because RNPureJwtModule decode() calls JJWT parse() without algorithm pinning. Attackers can craft a token with header alg none and an empty signature to have arbitrary claims accepted as verified, forging identities or roles.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/29/2026
The vulnerability identified in react-native-pure-jwt versions prior to 3.1.1 represents a critical failure in cryptographic validation logic within the Android implementation of the library. Specifically, the RNPureJwtModule decode function relies on the underlying JJWT library's parse method without enforcing strict algorithm verification constraints. This architectural oversight creates a scenario where the application fails to validate that the signing algorithm specified in the JSON Web Token header matches an expected set of secure algorithms. Consequently, the system does not reject tokens that attempt to exploit known weaknesses in JWT processing by omitting or nullifying the signature requirement.
This flaw directly enables a signature verification bypass, allowing unauthenticated attackers to forge valid-looking authentication tokens. By crafting a token with the algorithm field set to none and providing an empty signature, an attacker can manipulate the payload claims without possessing the secret key used for legitimate signing operations. The JJWT library, when not explicitly configured to reject such requests, will parse these malformed tokens as if they were legitimately signed. This behavior violates fundamental security principles regarding data integrity and authenticity in distributed authentication systems.
The operational impact of this vulnerability is severe, particularly in applications relying on JWTs for session management or role-based access control. An attacker can forge arbitrary claims within the token payload, effectively impersonating any user or elevating their privileges to administrative levels without valid credentials. This capability undermines the entire trust model of the application's authentication mechanism. Since the forged tokens are accepted as verified by the backend services or local security checks that depend on this library, attackers gain unauthorized access to protected resources and sensitive data associated with other users.
From a classification perspective, this issue aligns closely with CWE-347, which describes Improper Verification of Cryptographic Signature. The attack vector leverages the algorithm confusion technique, where an attacker tricks the verification process into accepting unsigned or weakly signed tokens as valid. In terms of offensive security frameworks, this vulnerability facilitates techniques associated with ATT&CK T1528, specifically Steal Application Access Token, by allowing adversaries to forge credentials that mimic legitimate session identifiers. The lack of algorithm pinning is a common misconfiguration in JWT implementations where developers assume the library handles all edge cases securely without explicit configuration.
To mitigate this vulnerability, it is imperative to upgrade react-native-pure-jwt to version 3.1.1 or later, which addresses these validation gaps by enforcing stricter verification protocols. For applications unable to immediately update, a temporary mitigation involves implementing custom JWT parsing logic that explicitly checks the algorithm header against an allowlist of secure algorithms such as HS256 or RS256 before passing the token for further processing. Developers must ensure that any cryptographic library used in authentication flows is configured with explicit algorithm constraints and never accepts none as a valid signing method. Regular security audits focusing on JWT handling practices are recommended to prevent similar misconfigurations in future development cycles.