Use of a Broken or Risky Cryptographic Algorithm
| Property | |
|---|---|
| Language | |
| Severity | |
| CWE | CWE-327: Use of a Broken or Risky Cryptographic Algorithm |
| OWASP | A02:2021 – Cryptographic Failures |
| Confidence Level | High |
| Impact Level | High |
| Likelihood Level | Low |
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.