All vulnerabilities

Servers and applications

GHSA-fw4f-cghv-2v33

Use of Cryptographically Weak Pseudo-Random Number Generator for API Key Generation

Severity
Medium 6.5
Published
11 Feb 2026
Last changed
11 Feb 2026
Added to UpHeron
3 Nov 2026
Fixed in
1.4.2
Weakness
CWE-338
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Read data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
Sources
Project advisories (GitHub)

Description

The software uses Python's random module for generating API keys. This module relies on a cryptographically weak pseudo-random number generator (Mersenne Twister), which could allow an attacker to predict the generated API keys.

The API key generation process in this software relies on a cryptographically weak Pseudo-Random Number Generator (PRNG), specifically the "Mersenne Twister" algorithm. While Mersenne Twister has good statistical properties, it is deterministic and therefore not suitable for generating security-sensitive values like API keys.

This vulnerability may allow an attacker to predict generated API keys. If an attacker successfully predicts a key, they could impersonate legitimate users, leading to unauthorized access to confidential information, data tampering, or other malicious actions.

From langgenius/dify's security advisory.

Affected software

SoftwareAffected versions
DifyServers and applications · github:langgenius/dify
  • Every version before 1.4.2

About Dify

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

From its GitHub repository.
GitHub stars
161,177GitHub, 15 Nov 2026
Forks
25,501GitHub, 15 Nov 2026
Latest release
1.19.0GitHub, 15 Nov 2026
Released
4 Nov 2026GitHub
First published on GitHub
12 Apr 2023GitHub

References