Property
Languagepython
Severityhigh
CWECWE-327: Use of a Broken or Risky Cryptographic Algorithm
OWASPA02:2021 – Cryptographic Failures
Confidence LevelHigh
Impact LevelHigh
Likelihood LevelLow

Description#

Using Flask’s secret key as the salt for HashIDs exposes the key because HashIDs are not cryptographically secure. Attackers can reverse-engineer the secret key by analyzing enough generated HashIDs.

Impact#

If exploited, an attacker can recover the Flask secret key, allowing them to forge session cookies or other sensitive tokens. This could lead to full compromise of user sessions, data breaches, or unauthorized access to protected parts of the application.