Security Traps
process.envvalues are strings —PORT=3000is"3000", parseInt needed- Missing env var is
undefined— no error, check explicitly on startup eval()with user input — remote code executionexec(userInput)— command injection, useexecFilewith args array- Path traversal —
../../../etc/passwd, validate withpath.resolve+ prefix check - Prototype pollution —
obj[userKey] = valcan modify__proto__ npm auditregularly — dependencies have vulnerabilities- Never log secrets — sanitize before logging, check for tokens/passwords