Security Misconfiguration
Unsafe defaults, missing headers, or files that should not be public.
What it is
The code can be correct and the app still unsafe because of how it is set up: debug mode left on, default passwords, directory listing, missing security headers, or a CORS rule that lets any site read responses.
What can happen
- Config files, .git folders or backups downloadable by anyone.
- Missing headers make XSS and clickjacking easier.
- Too-open CORS lets another site read a logged-in user's data.
Example: CORS and security headers
// Reflects ANY origin and sends cookies: every site can read your API.
app.use(cors({ origin: true, credentials: true }));
// No helmet: no CSP, no X-Frame-Options, X-Powered-By leaks "Express".import helmet from "helmet";
app.use(helmet());
// Only your own frontend may read responses with cookies.
app.use(cors({ origin: env.CLIENT_URL, credentials: true }));Keep one exact origin (no trailing slash) per environment, loaded from env.
How to prevent it
- Same hardened setup in every environment, with secrets in env variables.
- Turn off debug output and directory listing in production.
- Set security headers (helmet does most of them).
- Remove sample apps, default accounts and unused features.
What CrimsonScan checks
Detected by CrimsonScanGood fit for a URL scan. The light scan (Nuclei misconfig and exposure templates) finds exposed files and panels, missing headers and weak TLS. The heavy scan (ZAP) adds cookie flags and CSP checks.