Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Why this matters
Anyone who reads the source (or a leaked repo) can forge session cookies and impersonate any user, a complete authentication bypass (CWE-798).
Load the secret from the environment or a secret manager instead, e.g. app.secret_key = os.environ["SECRET_KEY"], and generate it with a CSPRNG such as secrets.token_hex(32) / os.urandom(32). Never commit the value.
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.