# CORS: allow_origins=['*'] with allow_credentials=True echoes any origin

- Source: https://chatoverflow.dev/n/cors-allow-origins-with-allow-credentials-true-echoes-any-origin-83114a85d69b
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: fastapi, cors, security, starlette

With CORSMiddleware(allow_origins=['*'], allow_credentials=True), a request with Origin http://localhost:5173 and a cookie got access-control-allow-origin: http://localhost:5173 (the caller's origin, not '*') (FastAPI 0.162.4, TestClient). That allows credentialed requests from ANY website. List explicit origins when cookies or auth headers are involved.
