Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-35042 — fast-jwt

🟠 CVSS 8.0 — High ⚠️ Exploit Public CWE-345 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

fast-jwt accepts unknown crit header extensions (RFC 7515 violation)

Summary

fast-jwt does not validate the crit (Critical) Header Parameter defined in RFC 7515 §4.1.11. When a JWS token contains a crit array listing extensions that fast-jwt does not understand, the library accepts the token instead of rejecting it. This violates the MUST requirement in the RFC.

RFC Requirement

RFC 7515 §4.1.11:

> If any of the listed extension Header Parameters are **not understood

> and supported by the recipient, then the JWS is invalid**.

Proof of Concept

```javascript

const { createSigner, createVerifier } = require("fast-jwt"); // v3.3.3

const signer = createSigner({ key: "secret", algorithm: "HS256" });

const token = signer({

sub: "attacker",

role: "admin",

header: { crit: ["x-custom-policy"], "x-custom-policy": "require-mfa" },

});

// Should REJECT — x-custom-policy is not understood

const verifier = createVerifier({ key: "secret", algorithms: ["HS256"] });

try {

const result = verifier(token);

console.log("ACCEPTED:", result);

// Output: ACCEPTED: { sub: 'attacker', role: 'admin' }

} catch (e) {

console.log("REJECTED:", e.message);

}

```

Expected: Error — unsupported critical extension

Actual: Token accepted.

Comparison

```javascript

// jose (panva) v4+ — correctly rejects

const jose = require("jose");

await jose.jwtVerify(token, new TextEncoder().encode("secret"));

// throws: Extension Header Parameter "x-custom-policy" is not recognized

```

Impact

  • Split-brain verification in mixed-library environments
  • Security policy bypass when crit carries enforcement semantics
  • Token binding bypass (RFC 7800 cnf confirmation)
  • See CVE-2025-59420 for full impact analysis

Suggested Fix

In src/verifier.js, add crit validation after header decoding:

```javascript

const SUPPORTED_CRIT = new Set(["b64"]);

function validateCrit(header) {

if (!header.crit) return;

if (!Array.isArray(header.crit) || header.crit.length === 0)

throw new Error("crit must be a non-empty array");

for (const ext of header.crit) {

if (!SUPPORTED_CRIT.has(ext))

throw new Error(Unsupported critical extension: ${ext});

if (!(ext in header))

throw new Error(Critical extension ${ext} not present in header);

}

}

```

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity high, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: None.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

CVE-2026-35042 is classified as CWE-345: Insufficient Verification of Data Authenticity. Data is trusted without confirming it really came from the claimed source and was not altered.

Affected software

CVE-2026-35042 is recorded against 1 package.

  • fast-jwt

Timeline and source

Published on 3 April 2026 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Advisory)
github.com (Package)
www.rfc-editor.org (Web)

Other advisories for this package

fast-jwt has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-345: Insufficient Verification of Data Authenticity) in other software:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CWE CWE-345
Public Exploit ⚠️ Yes
Source OSV
Published 2026-04-03
Updated 2026-08-20
Modified 2026-06-17
Fix URL N/A

Affected Packages

Software From version Fixed in
fast-jwt

Similar Threats

Exploit Protection

Are you running fast-jwt?

CVE-2026-35042 carries CVSS 8.0 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-35042 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026