react-native-pure-jwt CVE-2026-138378: Android Accepts alg:none JWTs, Letting Anyone Forge Tokens

Introduction

CVE-2026-138378 is a critical signature-verification bypass in react-native-pure-jwt, a React Native library for signing and decoding JSON Web Tokens. On Android, decode() accepted tokens with alg: none and an empty signature even when the app supplied a verification key. Anyone could forge a token with whatever claims they wanted, and the library would hand those claims back as verified. It is fixed in 3.1.1, released November 28. The same week also brought a batch of CVEs in web-token/jwt-framework, the most widely used JOSE library for PHP. There is no evidence that any of these are being exploited, but if your app trusts a JWT anywhere, check both.

What Happened

react-native-pure-jwt. Version 3.1.1 shipped on November 28, 2026. The CVE record (VulnCheck as CNA) was published on November 29, and GitHub advisory GHSA-5g2r-g3v9-9pc5 ("Android decode() accepts unsigned tokens (alg: none)") followed on November 30. Vishal Suwalka reported the bug and suggested the fix.

The cause is a classic. The Android module called JwtParser.parse() from JJWT 0.9.0. That method checks a signature only if the token has one, so an unsigned token sailed through even with a key configured. Version 3.1.1 switches to parseClaimsJws(), which rejects anything that isn't signed. The iOS module was not affected. skipValidation: true still skips verification by design.

Field Value
CVE CVE-2026-138378 / GHSA-5g2r-g3v9-9pc5
CWE CWE-347, Improper Verification of Cryptographic Signature
CVSS 4.0 9.1 Critical
CVSS 3.1 7.4 (CVE record, AC:H) / 9.1 (GHSA, AC:L)
Affected react-native-pure-jwt < 3.1.1, Android only
Fixed 3.1.1
Workaround None inside the library

web-token/jwt-framework (PHP). Spomky-Labs shipped fixes in late October and early November, and the CVE IDs went public between November 21 and 26:

CVE CVSS 4.0 Issue Fixed in
CVE-2026-134458 8.2 ECDH-ES derives at most 256 bits, so A256CBC-HS512 content ends up encrypted under an all-zero AES key 3.4.12, 4.0.8, 4.1.10, 4.2.4
CVE-2026-137581 8.2 Unbounded json_decode() on attacker-supplied tokens → denial of service 3.4.13, 4.0.9, 4.1.11, 4.2.6
CVE-2026-137558 6.3 RSA-OAEP accepts multi-block encrypted keys, enabling a CEK decryption oracle 3.4.13, 4.0.9, 4.1.11, 4.2.6
CVE-2026-137561 2.3 JWE decrypter accepts a non-empty encrypted key for dir / ECDH-ES, so tokens are malleable 3.4.13, 4.0.9, 4.1.11, 4.2.6
GHSA-47cp-rxmj-fwr5 High CPU exhaustion in RSA operations when GMP isn't available 4.2.9

Jeroen Robben is credited with CVE-2026-134458. Anthropic's OSS Scanner is credited with CVE-2026-137558. These are mostly JWE (encryption) bugs, not JWS signature bugs. They put the confidentiality of encrypted tokens at risk, plus availability, rather than letting anyone forge a signed login token.

None of the CVEs above is in CISA KEV, and none of the sources reviewed reports exploitation in the wild.

Why It Matters

alg: none is the oldest JWT bug in the book. RFC 7519 defines an "unsecured" JWT, and libraries have been shipping verifiers that honor it since 2015. It keeps coming back because of APIs like JJWT's parse(), which sound like "verify" but mean "verify if you feel like it."

How much this bug hurts depends on what the mobile app does with decode(). If the server verifies every token, a forged token on the device gets the attacker nothing. Plenty of apps make local trust decisions, though: offline license or entitlement checks, feature flags signed by the backend, QR-code or deep-link payloads, role claims that unlock admin screens, and tokens passed between apps. On Android, every one of those could be forged with a text editor. The iOS build of the same app behaved correctly, which makes the bug easy to miss in testing.

On the PHP side, web-token/jwt-framework sits underneath Symfony bundles, OAuth2 and OpenID Connect servers, and passkey/WebAuthn stacks. CVE-2026-134458 is the kind of bug that never shows up in testing: encryption and decryption both work, yet the key is effectively zero.

Who Is Affected

  • React Native apps depending on react-native-pure-jwt < 3.1.1 that ship on Android and call decode() with a key to verify tokens. iOS builds were not affected.
  • Already-installed app builds stay vulnerable until users update. Shipping 3.1.1 means publishing a new app release.
  • PHP applications using web-token/jwt-framework or web-token/jwt-library, directly or through bundles and OAuth/OIDC libraries:
  • 4.2.x before 4.2.9 (4.2.6 covers the CVEs; 4.2.9 adds the RSA CPU fix)
  • 4.1.x before 4.1.11, 4.0.x before 4.0.9
  • 3.4.x before 3.4.13 (the last 3.x release; the line is end of life)
  • The highest-severity PHP issue only matters if you use JWE with ECDH-ES and A256CBC-HS512. The DoS affects anything that parses untrusted tokens.

How to Protect Yourself

1. Find react-native-pure-jwt in your apps

npm ls react-native-pure-jwt
# or
yarn why react-native-pure-jwt
grep -n '"react-native-pure-jwt"' package.json package-lock.json yarn.lock 2>/dev/null

2. Update to 3.1.1 and ship a new Android build

npm install react-native-pure-jwt@^3.1.1
cd android && ./gradlew clean && cd ..
npx react-native run-android --variant=release   # smoke test, then publish

If your app has a minimum-version or forced-update check, raise it to the fixed release so users on old builds are prompted to upgrade.

3. Never let the client be the only verifier

Audit every place the app calls decode() and acts on the claims. Anything that grants access to data or features should be re-checked on the server. Treat client-side verification as a UX optimization, not a security control. On your backends, pin the algorithm list so unsigned tokens can't pass even if a library misbehaves:

// Node.js (jsonwebtoken)
jwt.verify(token, publicKey, { algorithms: ['RS256'] });
# Python (PyJWT)
jwt.decode(token, public_key, algorithms=["RS256"])
// Java (JJWT 0.11+): parseClaimsJws rejects unsigned tokens
Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(token);

4. Hunt for unsigned tokens in your logs

The Base64url encoding of a header beginning {"alg":"none" starts with eyJhbGciOiJub25l. Legitimate traffic should never contain it:

sudo zgrep -hE 'eyJhbGciOiJub25l|eyJhbGciOiJOb25l|eyJhbGciOiJOT05F' \
  /var/log/nginx/*.log* /var/log/app/*.log* 2>/dev/null | head

The variants cover none, None and NONE. This only catches tokens you log, such as tokens in URLs or headers that you record. Its absence proves little.

5. Patch web-token/jwt-framework (PHP)

composer show 'web-token/*'

# 4.2 line: take 4.2.9 for the RSA CPU fix as well
composer require web-token/jwt-library:^4.2.9 --update-with-dependencies
# or, if you use the full framework / bundle
composer update 'web-token/*' --with-all-dependencies
composer audit

On 3.4.x, update to 3.4.13 and plan the move to 4.x, since 3.x gets no more fixes.

6. If you use JWE with ECDH-ES and A256CBC-HS512, rotate

CVE-2026-134458 means data encrypted with that combination before the fix was effectively protected by an all-zero key. After upgrading, re-encrypt anything stored in that format and rotate the affected key agreement keys. Also consider any intercepted tokens from that period exposed.

7. Add JWT bugs to your dependency gates

Run npm audit and composer audit in CI and fail builds on critical advisories. Subscribe to GitHub security advisories for the auth libraries you depend on directly. Authentication libraries are small, deep in the dependency tree, and easy to forget.

Source