Express is configured to trust EVERY proxy (app.set('trust proxy', true) or the equivalent app.enable('trust proxy')).
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
With unbounded trust, Express believes the X-Forwarded-For and X-Forwarded-Proto headers on any incoming request. A client can then spoof its source IP (defeating IP allowlists, rate limiters, and audit logs) and spoof https, which can trick secure session cookies into being sent over plain HTTP.
Set trust proxy to the number of proxies actually in front of the app (e.g. app.set('trust proxy', 1)), or to a specific address / subnet / preset ('loopback', 'uniquelocal', a CIDR, or an allowlist array), so only your real infrastructure is trusted. Never trust all proxies.
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.express.trust-proxy-true -- <reason>