Skip to content

Commit 6073e8c

Browse files
WuMingDaoclaude
andcommitted
security(web): disable CORS on Vite dev server
Restrict CORS on the development server to prevent malicious websites from reading source files. This addresses the esbuild CVE pattern where `Access-Control-Allow-Origin: *` allows any site to fetch dev server files. Note: This only affects `vite dev`, not production builds or deployments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 47f3e96 commit 6073e8c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/web/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import { defineConfig } from 'vite'
55

66
// https://vite.dev/config/
77
export default defineConfig({
8+
server: {
9+
// Security: Restrict CORS in development
10+
// Only allow requests from same origin by default
11+
cors: false,
12+
},
813
plugins: [
914
react({
1015
babel: {

0 commit comments

Comments
 (0)