/

CVE-2026-41505

Severity:

HIGH RISK

(8.7)

Predictable Token / Identifier Generation in RELATE

CVE-2026-41505

Awaiting Analysis

Vulnerability type

Category:

Predictable Token / Identifier Generation

CWE:

CWE-330, CWE-338

Impact:

Authentication and Authorization Bypass

Severity:

HIGH RISK

(8.7)

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

RELATE used predictable logic to generate sign-in keys and exam ticket codes, making it feasible for an attacker to guess or brute-force these tokens.

Under conditions where attackers can target token-based authentication or exam access endpoints, this weakness may allow unauthorized account access, exam impersonation, or bypass of exam integrity controls.

Affected context

This vulnerability occurs in RELATE deployments that rely on application-generated tokens for:

  • User sign-in keys produced by auth.py's make_sign_in_key()
  • Exam ticket codes produced by exam.py's gen_ticket_code()

The issue arises when these tokens are used as proof of identity or authorization and are generated using patterns that are guessable or insufficiently random.

Exploit preconditions

  • Attack surface: Public-facing sign-in mechanisms and exam access endpoints that accept RELATE sign-in keys or exam ticket codes.
  • Required access: Network access to the RELATE application (e.g., a student, user, or external attacker who can reach the web interface).
  • Trigger point: Submission of crafted or brute-forced sign-in keys or exam ticket codes to the corresponding endpoints.
  • Why exploitation is possible: The token generation functions rely on predictable or low-entropy methods, reducing the effective search space and enabling an attacker to guess valid tokens in a practical timeframe.

Why this happens

The core issue maps to CWE-330: Use of Insufficiently Random Values and CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG).

Instead of using a cryptographically secure source of randomness and adequately long token values, the make_sign_in_key() and gen_ticket_code() functions generate values that follow patterns or have limited entropy.

When such tokens are used for authentication or authorization, predictability undermines their security guarantees and allows attackers to bypass normal login or exam access flows by guessing valid tokens.

Potential impact

  • Unauthorized use of sign-in keys, potentially leading to account takeover or impersonation.
  • Unauthorized access to exams via guessed exam ticket codes.
  • Compromise of exam integrity, including viewing or submitting exams as another user.
  • Circumvention of access controls that rely on token-based verification.
  • Erosion of audit trails and non-repudiation where tokens are treated as identity proof.

General mitigation guidance

Effective mitigation focuses on replacing predictable token generation with robust, cryptographically secure mechanisms and tightening how tokens are used:

  • Use cryptographically secure random number generators designed for security-sensitive tokens.
  • Increase token length and complexity to expand the search space beyond practical brute-force limits.
  • Bind tokens to user identity and context (e.g., user ID, exam ID, and expiration time) and validate those bindings on use.
  • Apply strict expiration and single-use semantics for sign-in keys and ticket codes.
  • Enforce rate limiting and anomaly detection on endpoints that accept tokens to reduce brute-force feasibility.
  • Design authentication and exam access workflows so that loss or prediction of a single token does not fully compromise an account or exam.

How teams detect issues like this

Organizations can detect and guard against predictable token generation through:

  • Static analysis and code review:
  • Flag use of non-cryptographic randomness APIs (e.g., generic PRNGs or deterministic patterns) in authentication or exam-related code paths.
  • Look for short or fixed-format tokens used for sign-in or access control.
  • Review custom token generation functions in authentication and exam modules for entropy and predictability concerns.
  • Runtime and operational monitoring:
  • Monitor for unusual rates of token validation attempts, suggesting brute-force activity.
  • Log token generation and validation events (without recording actual token values) to spot patterns or abuse.
  • Policy and tooling:
  • Enforce secure coding guidelines that require cryptographically secure RNGs for all security-sensitive tokens.
  • Integrate automated code scanning tools that include rules for CWE-330 and CWE-338 in CI pipelines.

Sources

SourceLink
github.comgithub.com/inducer/relate/commit/2f68e16cd3b96d25c188c1aa3f7e13cdb15cdaeb
github.comgithub.com/inducer/relate/security/advisories/GHSA-rvx5-95mm-p77v

Frequently asked

questions

Exploitability depends on how exposed the token-based endpoints are and how frequently tokens are issued. In environments with public-facing sign-in or exam URLs and high numbers of tokens, attackers may have realistic opportunities to brute-force or guess valid tokens.

Not necessarily. An attacker primarily needs network access to the RELATE application and knowledge of where sign-in keys or exam ticket codes are submitted. In some configurations, even unauthenticated attackers could attempt token guessing.

Replace all custom or weak token generation logic with cryptographically secure randomness, ensure tokens are sufficiently long, and enforce strict validation, binding, and expiration semantics wherever tokens gate access.

Standardize on vetted security libraries for token and session ID generation, prohibit use of non-cryptographic PRNGs in authentication or authorization paths, and include explicit checks for CWE-330/CWE-338 patterns in code review and automated analysis.

Find out what's already
exploitable in your codebase.