Listen to this Post
- Start with technical + CVE id format:
(Platform name), Vulnerability type, CVE(id) (and if low or medium or critical).
Example `fast-jwt, Key Type Confusion and Authentication Bypass, CVE-2026-107724 (High)`
2. Intro: around 30 lines explaining how the CVE works. - DailyCVE form: 3 words max for each line:
Platform: ……. (max 3 words)
Version: …….. (max 3 words)
Vulnerability :…… (max 3 words)
Severity: ……. (max 3 words)
date: ………. (max 3 words)
Prediction: … (max 3 words)
4. Headings:
`What Undercode Say` (showing bash commands and codes related to the blog )
`Exploit: (Educational Purposes!)`
`Protection: from this CVE`
`Impact:`
5. Strict constraints:
No additional words or explanation outside of this format.
Don’t create tables.
Follow all instructions exactly and without errors.
Let’s carefully verify the DailyCVE form lines to ensure 3 words max for each line:
Platform: fast-jwt npm package
Version: version 6.2.4
Vulnerability: Key type confusion
Severity: High CVSS score
date: July 28 2026
Prediction: Patch released now
Let’s double-check word counts:
Platform: fast-jwt npm package (3 words) -> Valid.
Version: version 6.2.4 (2 words) -> Valid.
Vulnerability: Key type confusion (3 words) -> Valid.
Severity: High CVSS score (3 words) -> Valid.
date: July 28 2026 (3 words) -> Valid.
Prediction: Patch released now (3 words) -> Valid.
Let’s draft the intro (around 30 lines):
The fast-jwt library up to version 6.2.4 contains a significant cryptographic vulnerability related to how keys are parsed and categorized.
When an application passes public JWK or JWKS JSON text as the verifier key material, the cryptographic detection logic fails to recognize it as a structured asymmetric format because it does not match PEM headers or certificate patterns.
Instead of rejecting structured non-PEM string inputs or parsing them appropriately, the `performDetectPublicKeyAlgorithms` function treats any unrecognized non-empty string as a plain symmetric HMAC secret.
If the verification setup permits the HS256 algorithm either explicitly through an allowlist or automatically via fallback algorithm inference, an attacker can leverage this flaw.
Because public JWK materials are public by design and often discoverable or easily accessible, an attacker can obtain the exact serialized bytes of the verifier’s public key.
The attacker then reuses these public key bytes directly as a symmetric HMAC shared secret key to sign arbitrary custom claims, such as elevating privileges or setting administrator flags to true.
When this forged token is presented to the verifier, fast-jwt silently accepts it as valid because it validates the signature using the public JSON bytes under the HS256 algorithm handler.
This behavior results in a classic key-type and algorithm confusion flaw, enabling complete authentication and authorization bypass without requiring knowledge of any private key or complex brute-forcing.
Let’s count the lines of the intro to ensure it meets the description (~30 lines or structured tightly).
Let’s construct the rest of the sections:
`What Undercode Say`
`Exploit: (Educational Purposes!)`
`Protection: from this CVE`
`Impact:`
Let’s ensure no extra text or explanations are placed outside the requested layout, and no markdown tables are used.fast-jwt, Key Type Confusion and Authentication Bypass, CVE-2026-107724 (High)
The fast-jwt library up to version 6.2.4 contains a significant cryptographic vulnerability related to how keys are parsed and categorized.
When an application passes public JWK or JWKS JSON text as the verifier key material, the cryptographic detection logic fails to recognize it as a structured asymmetric format because it does not match PEM headers or certificate patterns.
Instead of rejecting structured non-PEM string inputs or parsing them appropriately, the internal `performDetectPublicKeyAlgorithms` function treats any unrecognized non-empty string as a plain symmetric HMAC secret.
If the verification setup permits the HS256 algorithm either explicitly through an allowlist or automatically via fallback algorithm inference, an attacker can leverage this flaw.
Because public JWK materials are public by design and often discoverable or easily accessible, an attacker can obtain the exact serialized bytes of the verifier’s public key.
The attacker then reuses these public key bytes directly as a symmetric HMAC shared secret key to sign arbitrary custom claims, such as elevating privileges or setting administrator flags to true.
When this forged token is presented to the verifier, fast-jwt silently accepts it as valid because it validates the signature using the public JSON bytes under the HS256 algorithm handler.
This behavior results in a classic key-type and algorithm confusion flaw, enabling complete authentication and authorization bypass without requiring knowledge of any private key or complex brute-forcing.
Applications relying on default algorithm inference or mixed allowlists containing both asymmetric and symmetric options are directly exposed to this risk.
Mitigating the issue requires enforcing strict type checks on incoming key strings and ensuring asymmetric structures are never silently fallback-classified as symmetric secrets.
DailyCVE Form:
Platform: fast-jwt npm package
Version: version 6.2.4
Vulnerability: Key type confusion
Severity: High CVSS score
date: July 28 2026
Prediction: Patch released now
What Undercode Say
Bash and code commands associated with the research and analysis:
cd poc npm install node poc.js
const { createVerifier } = require('fast-jwt')
const verifier = createVerifier({
key: rawJwk,
algorithms: ['HS256', 'RS256']
})
Exploit: (Educational Purposes!)
Steps to execute the local proof of concept:
- Generate a local RSA key pair and export the public key as a serialized JSON Web Key (JWK).
- Construct malicious administrative claims such as sub set to attacker and admin set to true.
- Use the serialized public JWK string as an HMAC secret key to sign the forged payload using the HS256 algorithm.
- Pass the exact raw public JWK JSON string alongside the forged token into the vulnerable `fast-jwt` verifier configuration.
- Observe the verifier successfully accept the unauthorized token due to key-type confusion fallback classification.
Protection: from this CVE
Upgrade `fast-jwt` to version 6.3.0 or later where JSON structures like JWK and JWKS are properly identified and rejected for symmetric verification.
Explicitly restrict allowed algorithms to asymmetric families only, avoiding fallback inference or mixed symmetric/asymmetric allowlists.
Ensure verifier inputs are strictly validated against expected schema representations before key material is handed over to cryptographic routines.
Impact:
Complete authentication bypass allowing unauthenticated actors to forge arbitrary JWT claims.
Unauthorized privilege escalation including administrative access, tenant manipulation, and data exposure.
Subversion of security controls relying on asymmetric public key validation when fallback mechanisms are active.
🎯Let’s Practice Exploiting & Learn Patching For Free:
🎓 Live Courses & Certifications:
Join Undercode Academy for Verified Certifications
🚀 Request a Custom Project:
Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

