Medium severityJavaScript / TypeScriptInsecure ConfigurationMEDIUM confidence
Express Trust Proxy All
Express 'trust proxy' is set to true, trusting X-Forwarded-For from every hop; a client can spoof its IP to bypass rate limiting or IP allowlists.
Standards mapping
- OWASP Top 10
- A05:2021 - Security Misconfiguration
- OWASP ASVS
- V14.3.2 (L1)
Vulnerable vs. safe
Flagged by this check
app.set("trust proxy", true);Passes - the safe pattern
app.set("trust proxy", 1);Why it matters & how to fix it
Express 'trust proxy' is set to true, trusting X-Forwarded-For from every hop; a client can spoof its IP to bypass rate limiting or IP allowlists. Set a specific hop count or trusted subnet instead of true.
References
Rule ID integsec-js-express-trust-proxy-all - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Insecure ConfigurationCORS Acao Wildcard Header
- JavaScript / TypeScript - Insecure ConfigurationCORS Wildcard Origin
- JavaScript / TypeScript - Insecure ConfigurationCORS Wildcard With Credentials
- JavaScript / TypeScript - Insecure ConfigurationCSRF Protection Disabled
- JavaScript / TypeScript - Insecure ConfigurationExpress X Powered By Enabled
- JavaScript / TypeScript - Insecure ConfigurationGraphql Introspection Enabled