HIGH AI PREVALENCE: HIGH auth.php.secret.hardcoded-jwt-key
A JWT signing key is a hard-coded string literal, passed to JWT::encode() / new Key() (firebase/php-jwt) or InMemory::plainText() / InMemory::base64Encoded() (lcobucci/jwt).
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
This key signs and verifies every token: committed to source control it is one search away from compromise, letting an attacker forge a token for any user or role (CWE-798). AI-generated samples inline the secret to make the snippet "just work" and it ships unchanged.
Read the key from the environment or a secret store instead: JWT::encode($payload, $_ENV['JWT_SECRET'], 'HS256'); new Key(getenv('JWT_SECRET'), 'HS256');
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.php.secret.hardcoded-jwt-key -- <reason>