Hono's cors() middleware is given an origin function that reflects the caller's origin straight back (origin: (origin) => origin) together with credentials: true.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
This echoes ANY requesting origin into Access-Control-Allow-Origin while allowing cookies and Authorization headers, effectively "allow credentialed cross-site requests from anywhere", a CSRF / account-takeover primitive (CWE-942).
Validate the origin against an allow-list before returning it, or pass an explicit list: cors({ origin: ['https://app.example.com'], credentials: true }) cors({ origin: (o) => (allowed.includes(o) ? o : null), credentials: true }) If the API is public and needs no cookies/auth headers, drop credentials (defaults to false).
(A literal origin: '*' with credentials is covered by auth.cors.wildcard-with-credentials; this rule targets the Hono reflect-the-origin function form, which that rule does not match.)
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.hono.cors-reflect-credentials -- <reason>