HIGH AI PREVALENCE: HIGH auth.rust.tls.accept-invalid-certs
A reqwest client is built with danger_accept_invalid_certs(true), which turns off TLS certificate validation.
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
Any attacker who can intercept the connection can present any certificate and read or tamper with the traffic, a man-in-the-middle hole. For OAuth/OIDC this leaks authorization codes, access tokens, and client secrets in transit.
Never accept invalid certificates. Leave validation on (the default). To trust a private CA in development, add it explicitly with ClientBuilder::add_root_certificate(cert) instead.
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.rust.tls.accept-invalid-certs -- <reason>