Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in Dify - #VU139842
Published: July 28, 2026
Vulnerability details
The vulnerability allows a remote attacker to predict generated API keys.
The vulnerability exists due to use of a cryptographically weak pseudo-random number generator in the generate_api_key() method and generate_string() function when generating API keys. A remote attacker can predict or reproduce API keys to predict generated API keys.
This issue stems from the use of Python's random module, which relies on the deterministic Mersenne Twister algorithm for security-sensitive key generation.