MEDIUM AI PREVALENCE: MEDIUM auth.py.crypto.ecb-mode
A symmetric cipher is configured in ECB mode.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
ECB encrypts each block independently, so identical plaintext blocks yield identical ciphertext, leaking structure and enabling block-shuffling attacks (CWE-327). This matters for anything auth-related: encrypted tokens, cookies, credentials.
Use an authenticated mode: AES-GCM (AESGCM / modes.GCM) or, failing that, CBC with a random IV plus a separate MAC.
VULNERABLE
SAFE
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
# oauthlint-disable-next-line auth.py.crypto.ecb-mode -- <reason>