/

CVE-2026-94456

Severity:

CRITICAL RISK

(9.1)

Insecure Randomness (CWE-330) in Postiz OAuth Flows

CVE-2026-94456

Awaiting Analysis

Vulnerability type

Category:

Insufficiently Secure Randomness

CWE:

CWE-330, CWE-338, CWE-341

Impact:

Credential Prediction and Account or Organization Compromise

Severity:

CRITICAL RISK

(9.1)

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

Postiz uses the predictable Math.random() generator to create OAuth credentials, API keys, client secrets, authorization codes, and PKCE verifiers. Because unauthenticated dynamic client registration can expose consecutive generated values, an attacker may reconstruct the generator state and derive credentials issued to other users or organizations.

Affected context

The vulnerability affects Postiz deployments where security-sensitive credentials are generated through a shared helper backed by Math.random(). Risk is increased when the OAuth dynamic client registration endpoint is publicly accessible and returns newly generated credentials, because observed output can provide information about the deterministic pseudorandom generator state.

Exploit preconditions

  • Attack surface: OAuth dynamic client registration endpoint and other flows using the shared credential-generation helper
  • Required access: Typically no authentication for the exposed dynamic registration endpoint
  • Trigger point: Generation and disclosure of client credentials or other values derived from the same pseudorandom stream
  • Why exploitation is possible: V8's deterministic xorshift128+ state can be reconstructed from sufficient consecutive outputs, allowing related past or future values to be predicted

Why this happens

The underlying bug is the use of a non-cryptographic pseudorandom number generator for secrets that require unpredictability. Math.random() is designed for general-purpose simulation and application behavior, not credential generation; its deterministic internal state can become predictable when enough output is observed. This maps primarily to CWE-330: Use of Insufficiently Random Values, with related characteristics covered by CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator and CWE-341: Predictable from Observable State.

Potential impact

  • Attackers may predict OAuth client secrets, authorization codes, access tokens, API keys, or PKCE verifiers
  • Unauthorized users may gain access to accounts, organizations, or connected services
  • Previously issued credentials may be reconstructed if the generator state is recovered
  • Future credentials generated by the shared helper may be compromised
  • Attackers could impersonate clients or access organization-level resources

General mitigation guidance

Mitigation generally focuses on replacing non-cryptographic randomness wherever generated values provide authentication, authorization, or secrecy.

Common defensive patterns include:

  • Use a platform-backed cryptographically secure random source for every security-sensitive value
  • Separate credential-generation utilities from ordinary application randomness
  • Ensure generated tokens, secrets, codes, and verifiers have sufficient entropy and appropriate lifetimes
  • Avoid exposing unnecessary generated credentials through unauthenticated registration responses
  • Rotate potentially exposed credentials and invalidate affected sessions or authorization artifacts
  • Apply least privilege to OAuth clients, API keys, and organization integrations
  • Enforce automated policies that prohibit Math.random() and similar weak generators in security-sensitive code paths

How teams detect issues like this

Organizations can identify this weakness through:

  • Static analysis rules for Math.random() or other non-cryptographic generators used near token, secret, key, code, or verifier creation
  • Code review checks for shared helpers that generate both ordinary identifiers and security credentials
  • Data-flow analysis tracing generated values into OAuth responses, authorization decisions, headers, or API authentication
  • Tests that verify security-sensitive values originate from approved cryptographic randomness APIs
  • API monitoring for unusually frequent dynamic client registrations or repeated credential-generation activity
  • Policy enforcement in CI and automated code review tools that flag weak randomness in authentication and authorization components

Sources

SourceLink
gadvisory.orggadvisory.org/advisories/PSA-2026-TD98KY
github.comgithub.com/gitroomhq/postiz-app
github.comgithub.com/gitroomhq/postiz-app/commit/9259cf2429e8cc0c88414e88d5e6c783d7ffba63
github.comgithub.com/gitroomhq/postiz-app/releases/tag/v2.24.0

Frequently asked

questions

Potentially. If the dynamic client registration endpoint is reachable without authentication and discloses generated credentials, an attacker may collect the output needed to infer the pseudorandom generator state.

The described attack can begin with unauthenticated access to the client registration endpoint. Compromising additional credentials may then provide access to other users, clients, or organizations.

Replace Math.random() with a platform-backed cryptographically secure random source for all tokens, secrets, authorization codes, API keys, and PKCE verifiers, while rotating values that may already have been exposed.

Maintain separate secure and non-secure randomness APIs, review credential-generation data flows, restrict registration responses, enforce entropy and lifetime requirements, and add CI policies that reject weak randomness in security-sensitive paths.

Find out what's already
exploitable in your codebase.