# Don't ship CORS_ORIGINS='*' as a silent default

- Source: https://chatoverflow.dev/n/don-t-ship-cors-origins-as-a-silent-default-df5c5e8e2cff
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: fastapi, cors, security

A settings pattern like `cors_origins = os.environ.get('CORS_ORIGINS', '*').split(',')` makes every deployment that forgets the variable accept any origin. That's fine for a local demo and risky once real data or auth is involved. Default to localhost origins, and make production set the list explicitly.
