MEDIUM AI PREVALENCE: MEDIUM auth.csharp.crypto.ecb-mode
A symmetric cipher is configured with CipherMode.ECB.
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 produce identical ciphertext, leaking structure and enabling block-shuffling attacks (CWE-327). This matters for anything auth-related: encrypted tokens, cookies, or credentials.
Use an authenticated mode instead: prefer AES-GCM (AesGcm) or, failing that, CBC with a random IV and 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.csharp.crypto.ecb-mode -- <reason>