# Permissive CORS Configuration - ID: go-permissive-cors - Severity: MEDIUM - CWE: CWE-942 (CWE-942) - Languages: Go - Frameworks: gin, echo, fiber, chi, gorilla ## Description CORS allows wildcard origin or reflects Origin header without validation. ## Detection Message CORS policy allows untrusted origins ## Remediation Whitelist specific allowed origins instead of using wildcards. ```go allowedOrigins := map[string]bool{ "https://app.example.com": true, } origin := r.Header.Get("Origin") if allowedOrigins[origin] { w.Header().Set("Access-Control-Allow-Origin", origin) } ``` Learn more: https://shoulder.dev/learn/go/cwe-942/permissive-cors ## Documentation [object Object] ## Related Rules - **FastAPI CORS Misconfiguration** [MEDIUM]: - **Flask CORS Misconfiguration** [MEDIUM]: - **Chi Permissive CORS** [MEDIUM]: - **Echo Permissive CORS** [MEDIUM]: - **Fiber Permissive CORS** [MEDIUM]: