This endpoint sends Access-Control-Allow-Credentials: true together with an Access-Control-Allow-Origin that is either the wildcard * or the request's own Origin reflected back unchecked.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
That combination lets any website make credentialed cross-origin requests and read the response, leaking the victim's session / OAuth tokens cross-origin (CWE-942), an account-takeover primitive. AI-generated code pairs these two headers to "make the browser call work" without an origin allowlist.
Echo the origin only after checking it against a trusted allowlist, e.g. if (in_array($origin, $allowed, true)) { header('Access-Control-Allow-Origin: ' . $origin); header('Access-Control-Allow-Credentials: true'); }
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.cors.wildcard-with-credentials -- <reason>