Problem
During frontend build, vite emits a security warning:
The `define` option contains an object with "PATH" for "process.env" key. It looks like you may have passed the entire `process.env` object to `define`, which can unintentionally expose all environment variables. This poses a security risk and is discouraged.
Root Cause
frontend/vite.config.js line 19-21:
define: {
"process.env": process.env
}
This passes the entire process.env to Vite's define, exposing all host env vars to the bundle.
Proposed Fix
Use a whitelist of required env vars:
define: {
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || "production")
// Add other specific vars as needed
}
Or use vite-plugin-environment for proper env var handling.
Acceptance Criteria
Aufwand
~15-30 min
Problem
During frontend build, vite emits a security warning:
Root Cause
frontend/vite.config.jsline 19-21:This passes the entire
process.envto Vite'sdefine, exposing all host env vars to the bundle.Proposed Fix
Use a whitelist of required env vars:
Or use
vite-plugin-environmentfor proper env var handling.Acceptance Criteria
cd frontend && npx vite buildruns without the PATH/process.env warningAufwand
~15-30 min