ersinkoc/security-check/sc-jwt

Claude Code and agent skill by ersinkoc/security-check

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

JWT implementation flaw detection — algorithm confusion, weak secrets, missing validation, and storage issues

Install

npx vskill@latest install ersinkoc/security-check/sc-jwt

SKILL.md

The same SKILL.md was published earlier as ersinkoc/security-check/sc-jwt.

SC: JWT Implementation Flaws

Purpose

Detects JWT (JSON Web Token) implementation vulnerabilities including algorithm confusion attacks (alg:none, RS256→HS256), weak signing secrets, missing expiration/audience/issuer validation, insecure client-side storage, JWK injection, and key ID (kid) manipulation.

Activation

Called by sc-orchestrator during Phase 2 when JWT usage is detected.

Phase 1: Discovery

Keyword Patterns to Search
"jwt", "JWT", "jsonwebtoken", "jose", "PyJWT", "java-jwt",
"sign(", "verify(", "decode(", "encode(",
"alg", "HS256", "RS256", "ES256", "none",
"expiresIn", "exp", "iat", "aud", "iss", "sub",
"localStorage.*token", "sessionStorage.*token",
"Bearer", "Authorization"
Vulnerability Patterns

1. Algorithm Confusion (alg:none):

javascript
// VULNERABLE: Not specifying allowed algorithms
const payload = jwt.verify(token, secret); // Accepts alg:none!
// SAFE: Specify algorithms explicitly
const payload = jwt.verify(token, secret, { algorithms: ['HS256'] });

2. Weak Signing Secret:

javascript
// VULNERABLE: Short/predictable secret
const token = jwt.sign(payload, 'secret');
const token = jwt.sign(payload, 'password123');
const token = jwt.sign(payload, process.env.JWT_SECRET || 'default');
// SAFE: Strong random secret (256+ bits)
const token = jwt.sign(payload, process.env.JWT_SECRET);
// Where JWT_SECRET is a 64+ character random string

3. Missing Expiration:

python
# VULNERABLE: No expiration
token = jwt.encode({"user_id": user.id}, SECRET_KEY, algorithm="HS256")
# SAFE: With expiration
token = jwt.encode({
"user_id": user.id,
"exp": datetime.utcnow() + timedelta(hours=1)
}, SECRET_KEY, algorithm="HS256")

4. JWT in localStorage (XSS Theft):

javascript
// VULNERABLE: XSS can steal token
localStorage.setItem('token', jwtToken);
// SAFE: HttpOnly cookie
res.cookie('token', jwtToken, {
httpOnly: true,
secure: true,
sameSite: 'strict'
});

5. Missing Audience/Issuer Validation:

javascript
// VULNERABLE: No audience/issuer check
const payload = jwt.verify(token, secret, { algorithms: ['HS256'] });
// SAFE: Validate audience and issuer
const payload = jwt.verify(token, secret, {
algorithms: ['HS256'],
audience: 'https://api.example.com',
issuer: 'https://auth.example.com'
});

6. Kid Parameter Injection:

javascript
// VULNERABLE: kid used in SQL query or file path
const kid = header.kid;
const key = db.query(`SELECT key FROM keys WHERE id = '${kid}'`); // SQL injection!
// Or: const key = fs.readFileSync(`/keys/${kid}`); // Path traversal!

Severity Classification

  • Critical: Algorithm confusion allowing token forgery, SQL injection via kid
  • High: Weak signing secret (guessable), missing algorithm validation
  • Medium: JWT in localStorage (requires XSS), missing expiration
  • Low: Missing audience/issuer validation, long expiration time

Output Format

Finding: JWT-{NNN}
  • Title: JWT {vulnerability type}
  • Severity: Critical | High | Medium | Low
  • Confidence: 0-100
  • File: file/path:line
  • Vulnerability Type: CWE-345 (Insufficient Verification of Data Authenticity) | CWE-347 (Improper Verification of Cryptographic Signature)
  • Description: {What was found}
  • Impact: Authentication bypass, token forgery, account takeover.
  • Remediation: {Specify algorithms, use strong secrets, validate exp/aud/iss, store in httpOnly cookies}
  • References: https://cwe.mitre.org/data/definitions/345.html

Common False Positives

  1. JWT decode (not verify) — jwt.decode() for reading payload (without verification) in non-auth contexts
  2. Test tokens — hardcoded tokens in test files
  3. Public key operations — RS256 verification with public key is safe (no secret needed)
  4. Token refresh logic — legitimate token reissuance patterns

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
56
Repository forks
5
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Aug 2026, 3 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ersinkoc/security-check/sc-jwt/badge)](https://verified-skill.com/skills/ersinkoc/security-check/sc-jwt)

Something wrong with this skill or its page? Tell us.