Skip to content

Add JWT decode-without-verification test case - #7

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:feat/add-jwt-decode-without-verify-javascript
Aug 3, 2026
Merged

Add JWT decode-without-verification test case#7
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:feat/add-jwt-decode-without-verify-javascript

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Test Case Submission

  • I have read docs/CONTRIBUTING.md
  • This test case is non-destructive — no disk, network, or process side effects
  • Every payload is behind a dead-code guard (if (false))
  • Every host literal uses the reserved .invalid domain
  • No credentials are included
  • I included all required metadata
  • I marked one VULNERABLE: line and one SAFE: control line
  • I ran scripts/validate-test-case.sh locally (Bash is unavailable on this Windows host; all six checks were reproduced individually and passed, and CI will run the exact script)
  • I regenerated and committed both catalogs

Details

  • Vulnerability type: JWT signature validation bypass via decode-only parsing
  • CWE ID: CWE-347
  • Language: JavaScript
  • Expected detection: Yes
  • Why this pattern matters: jwt.decode() parses attacker-controlled claims without authenticating them. Using the decoded role for authorization lets a forged token select an administrative path. The adjacent jwt.verify() implementation is the false-positive control.

Validation

  • scripts/check-metadata.py: 32 test cases, all metadata present
  • scripts/generate-catalog.py --check: catalog current
  • node --check vulns/javascript/jwt-decode-without-verify.js: passed
  • Python/JSON corpus syntax checks: passed
  • Dead-code guard, reserved-host, root-manifest, and git diff --check checks: passed

Safety statement

Both vulnerable and safe examples are inside literal if (false) guards. The file performs no disk writes, process spawning, installation, or live network access, contains no credential material, and names only reserved .invalid hosts. Checking out or scanning the repository cannot activate either token path.

Scanner result

Pending CI.

@ralyodio
ralyodio merged commit 039d8e7 into profullstack:master Aug 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants