/

CVE-2026-79575

Severity:

HIGH RISK

(7.5)

Predictable JWT Secret (CWE-330) in yfexam-exam v2.0

CVE-2026-79575

Deferred

Vulnerability type

Category:

Use of Insufficiently Random Values

CWE:

CWE-330

Impact:

JWT Forgery and Authentication Bypass

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

yfexam-exam v2.0 derives its JWT signing secret from a username and the current month rather than using a randomly generated server-side key. An attacker who can infer or test likely usernames and the date-based value may recover the secret and forge valid tokens.

Affected context

The issue occurs in deployments of yfexam-exam v2.0 that generate JWT signing material from predictable user and calendar data. It becomes risky when an attacker can observe or submit tokens, identify valid usernames, and perform repeated offline or online guesses against the derived secret.

Exploit preconditions

  • Attack surface: JWT authentication and token validation
  • Required access: Typically the ability to obtain, observe, or submit application JWTs; valid username information may also assist guessing
  • Trigger point: Token creation or validation using the derived signing secret
  • Why exploitation is possible: The signing key is deterministic and based on low-entropy, predictable inputs rather than cryptographically random server-side key material

Why this happens

The vulnerability results from deriving a JWT signing secret from predictable application data, specifically the username and current month. This insecure pattern reduces the effective key space and allows attackers to reproduce or brute-force the value, mapping to CWE-330: Use of Insufficiently Random Values. JWT signing keys should not be constructed from public or easily guessed attributes.

Potential impact

  • Attackers could forge JWTs accepted as authentic
  • Authentication checks may be bypassed
  • Unauthorized access to user or administrative functionality may occur
  • Account impersonation or privilege escalation could result
  • Sensitive application data could be accessed or modified

General mitigation guidance

Mitigation generally focuses on using cryptographically random, server-side signing keys that are independent of usernames, dates, and other predictable inputs.

Common defensive patterns include:

  • Generating signing keys with a cryptographically secure random source
  • Keeping key material outside user-controlled and publicly observable data
  • Separating signing secrets from application configuration exposed to routine users
  • Applying key rotation and controlled revocation procedures
  • Limiting JWT privileges, lifetime, audience, and scope
  • Running authentication services with least privilege and protecting secret storage

How teams detect issues like this

Organizations can identify similar weaknesses through:

  • Static analysis for JWT secrets constructed from usernames, dates, identifiers, or other low-entropy values
  • Code review checks for deterministic signing-key generation
  • Tests that verify signing keys are random, sufficiently long, and stable only within an approved rotation period
  • Monitoring for repeated invalid-token attempts and unusual token claims
  • Policy enforcement requiring secrets to come from approved random generators or managed secret stores
  • Automated security review tools that flag predictable cryptographic material

Sources

SourceLink
github.comgithub.com/fangtang7/CVE/blob/main/yf-exam/JWT.md

Frequently asked

questions

It may be remotely exploitable when the application exposes JWT-authenticated endpoints and an attacker can infer the derivation inputs or test forged tokens.

Not necessarily. The required access depends on token visibility, username disclosure, endpoint behavior, and whether token guesses can be submitted without prior authentication.

Use a cryptographically random server-side signing key that is independent of usernames, dates, and other predictable values, and protect it through controlled secret management.

Review cryptographic key-generation logic, prohibit predictable seed material, test token-signing implementations, apply short token lifetimes where appropriate, and monitor authentication anomalies.

Find out what's already
exploitable in your codebase.