no-cors-wildcard-with-credentials
Disallow wildcard CORS origins when credentials are enabled.
Why
Reflecting every origin while allowing credentials can let an untrusted site read authenticated cross-origin responses.
Fix
Enumerate the trusted origins that may receive credentialed responses.
Examples
app.use(cors({ origin: "*", credentials: true }));app.use(cors({ origin: "https://app.example.com", credentials: true }));