Why it matters
Its claims are whatever the sender wrote.
How to fix it
Decode with the verification key and an explicit algorithms list, and leave signature verification on.
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 claims(token):
return jwt.decode(token, options={"verify_signature": False})import jwt
def claims(token, key):
return jwt.decode(token, key, algorithms=["RS256"])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 debug enabled (Python)
PythonSeverity: High
trustivan-python-flask-debug-enabled - Insecure random secret (Python)
PythonSeverity: Medium
trustivan-python-insecure-random-secret - SSL unverified context (Python)
PythonSeverity: High
trustivan-python-ssl-unverified-context - Tempfile mktemp (Python)
PythonSeverity: Medium
trustivan-python-tempfile-mktemp - TLS verification disabled (Python)
PythonSeverity: High
trustivan-python-tls-verification-disabled - XML external entities (Python)
PythonSeverity: Medium
trustivan-python-xml-external-entities
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