npm package

jsonwebtoken 4.2.2 vulnerabilities, and the version that fixes all of them

jsonwebtoken 4.2.2 has 3 known vulnerabilities (1 rated high or critical); 9.0.0 fixes all of them. The maintainers deprecated this release.

npm (opens in a new tab) describes it as “JSON Web Token implementation (symmetric and asymmetric)”

Known vulnerabilities
3
1 rated high or critical
Released
Mar 26, 2015
Latest is 9.0.3
Downloads last week
274
Under 1% of jsonwebtoken downloads
Licence
MIT
Pulls in
24 packages
Resolved by deps.dev
Status
Deprecated release

What to upgrade to

9.0.0 is the closest release with no known vulnerabilities.

  • 9.0.0Upgrade to this

    Fixes all 3 known vulnerabilities. Released Dec 21, 2022.

    No known vulnerabilities
  • 9.0.3

    Latest release. Released Dec 4, 2025.

    No known vulnerabilities

Hand the fix to your coding agent

One task with the upgrade, the file to change and why. Paste it into Claude Code, Cursor or Codex.

Findings

Every advisory for jsonwebtoken 4.2.2

Known exploited first (CISA KEV), then by how likely they are to be exploited (FIRST EPSS), then by severity. Each id links to its OSV.dev record.

  1. WarningCVE-2022-23541 on OSV.dev (opens in a new tab)GHSA-hjrf-2m68-5959EPSS: top 46%

    jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC

    Fixed in 9.0.0. Published Dec 22, 2022.

  2. WarningCVE-2022-23540 on OSV.dev (opens in a new tab)GHSA-qwph-4952-7xr6EPSS: top 56%

    jsonwebtoken vulnerable to signature validation bypass due to insecure default algorithm in jwt.verify()

    Fixed in 9.0.0. Published Dec 22, 2022.

  3. CriticalCVE-2022-23539 on OSV.dev (opens in a new tab)GHSA-8cf7-32gw-wr33EPSS: top 59%

    jsonwebtoken unrestricted key type could lead to legacy keys usage

    Fixed in 9.0.0. Published Dec 22, 2022.

Who is still on a vulnerable jsonwebtoken

6% of last week’s 60.4M jsonwebtoken downloads went to versions with known vulnerabilities.

From npm’s per-version download counts for the last 7 days, each version checked against OSV.dev. The versions checked cover over 99% of downloads.

Is jsonwebtoken the only one?

Paste a public GitHub repo or drop your package.json and see every vulnerable, end-of-life or deprecated dependency, with one fix task. Free, no sign-up.

Check your whole repo

How this page is checked

StackPrism asks OSV.dev which advisories affect exactly jsonwebtoken 4.2.2, merges duplicates filed under several ids, and ranks them with CISA’s Known Exploited Vulnerabilities list and FIRST EPSS. Release dates and deprecation come from deps.dev and npm. No AI writes this page: every sentence comes from that data, refreshed every few hours.

Last checked against npm, OSV.dev, deps.dev, CISA KEV and FIRST EPSS.