Why it matters
Anyone who reads it can mint tokens this service accepts.
How to fix it
Load the key from the environment or a secret store, and rotate the committed value.
Example
The rule's own test fixtures, verbatim: the test suite requires the rule to report the first and not the second.
import jwt
def issue(user_id):
return jwt.encode({"sub": user_id}, "production-signing-key-2026", algorithm="HS256")import os
import jwt
def issue(user_id):
return jwt.encode({"sub": user_id}, os.environ["JWT_KEY"], algorithm="HS256")What TrustIvan reads
Runs on repository scans of Python source once static analysis is turned on (SAST_RULES and the separately built analyzer image); it is off by default.
Weakness classes and references
Related checks
- Flask hardcoded secret key (Python)
PythonSeverity: High
trustivan-python-flask-hardcoded-secret-key - Weak RSA key (Python)
PythonSeverity: Medium
trustivan-python-weak-rsa-key - Django mark safe non literal (Python)
PythonSeverity: Medium
trustivan-python-django-mark-safe-non-literal - CORS wildcard credentials (Python)
PythonSeverity: High
trustivan-python-cors-wildcard-credentials - Mass assignment from request input (Python)
PythonSeverity: Medium
trustivan-python-taint-mass-assignment - Ai sdk use (Python)
PythonSeverity: Low
trustivan-python-ai-sdk-use
Terms: SAST (static application security testing), Taint analysis, CWE (Common Weakness Enumeration), OWASP Top 10
All static analysis (SAST) checks · The whole catalogue · How this works in TrustIvan · Documentation