Skip to main content

A02:2025 — Security Misconfiguration

OWASP · Top 10:2025 · Reading time: ~12 min

At a Glance​

Rank#2 in 2025 (up from #5 in 2021; #6 in 2017)
Mapped CWEs16
Example CWEsCWE-16 Configuration, CWE-611 XML External Entity Reference (XXE), CWE-1004 Sensitive Cookie Without HttpOnly, CWE-614 Sensitive Cookie Without Secure, CWE-942 Permissive Cross-domain Policy, CWE-489 Active Debug Code, CWE-526 Exposure of Sensitive Information Through Environment Variables
Why it climbedApplications are increasingly assembled from configurable services, frameworks and cloud resources — more settings, more teams, more chances to get one wrong

In Plain English​

The code can be perfect and the application still be wide open — because something around it was set up insecurely. A default admin password nobody changed. A debug page left on in production. A storage bucket set to public "just for testing." A server that cheerfully prints a full stack trace to anyone who breaks a request.

Misconfiguration is the security equivalent of building a vault and leaving the door propped open.

Secure code
+ insecure framework setting
+ insecure server setting
+ insecure cloud setting
= insecure application

How It Happens​

CategoryTypical examples
Defaults left in placeDefault accounts (admin/admin), sample apps, default API keys, default TLS settings.
Debug/dev features in productionDebug mode, stack traces, Spring Boot Actuator endpoints, PHP phpinfo(), GraphQL introspection, Swagger UI with live "try it" enabled.
Unnecessary features enabledOpen ports, unused services, directory listing, HTTP methods like TRACE/PUT enabled on a static server.
Overly permissive cloud settingsPublic storage buckets, security groups open to 0.0.0.0/0, wildcard IAM policies ("Action": "*").
Missing hardening headersNo Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, or frame protections.
Insecure cookie settingsSession cookies missing HttpOnly, Secure or SameSite.
Unsafe parser defaultsXML parsers resolving external entities (XXE) — moved into this category in 2021.
Inconsistent environmentsStaging is hardened, production isn't — or a forgotten old server is still running.
Secrets in the wrong placeCredentials in environment dumps, .env files served by the web server, or .git directories exposed publicly.
Freshers' takeaway

Misconfiguration bugs are often the easiest findings for beginners. You don't need to understand complex exploitation — just know where to look. Visiting /.git/HEAD, /.env, /server-status or /actuator/env on a test target and finding something there is a real, reportable vulnerability.


Vulnerable vs. Fixed Configuration​

Vulnerable — stack traces sent to the client:

app.use((err, req, res, next) => {
res.status(500).send(err.stack); // leaks file paths, library versions, queries
});

Fixed — generic message to the user, detail to the logs:

app.use((err, req, res, next) => {
const errorId = crypto.randomUUID();
logger.error({ errorId, err, path: req.path }); // full detail stays server-side
res.status(500).json({ error: 'Internal error', errorId });
});

The errorId lets support staff find the real error without exposing it.


Real-World Incidents​

  • Exposed cloud storage and databases — Over the past decade, researchers have repeatedly found huge datasets in publicly readable storage buckets and internet-exposed databases (Elasticsearch, MongoDB) running without authentication. No exploit was needed — just a search engine for exposed services.
  • Capital One (2019) — Beyond the SSRF itself, the impact depended on a misconfigured firewall and an overly permissive IAM role. Misconfiguration turned a single bug into a mass data breach.
  • Exposed .git directories — A recurring finding in which a deployed site's version-control directory can be downloaded, letting an attacker reconstruct source code, history and sometimes hard-coded secrets.

How to Test for It​

  • Fingerprint the stack from headers, error pages, cookies and file extensions.
  • Try default credentials on every login you find, especially admin consoles, routers, CI dashboards and databases.
  • Request common sensitive paths: /.git/HEAD, /.env, /config.json, /backup.zip, /server-status, /phpinfo.php, /actuator, /swagger-ui/, /graphql (introspection).
  • Break requests deliberately (bad types, malformed JSON, very long values) and look for stack traces or debug output.
  • Check response headers for HSTS, CSP, X-Content-Type-Options, frame protection — and for version-leaking headers.
  • Inspect every cookie for HttpOnly, Secure and SameSite.
  • Test allowed HTTP methods with an OPTIONS request and by trying PUT, DELETE and TRACE.
  • Look for directory listing on static asset paths.
  • For cloud targets in scope: check storage bucket permissions, open security groups and public snapshots.
  • Feed any XML input a harmless external-entity test to check whether entities are resolved.

Tools that help: nikto and nuclei for known misconfiguration signatures, testssl.sh for TLS settings, cloud posture tools (for example Prowler or ScoutSuite) for AWS/Azure/GCP.


How to Prevent It​

PracticeWhy
Repeatable hardeningBuild every environment from the same automated configuration (infrastructure as code, golden images), so production can't drift from the reviewed baseline.
Minimal platformRemove sample apps, unused features, frameworks and ports. Anything not installed can't be misconfigured.
Separate config per environment, same security baselineDev can have debug on; production must not — enforced by the pipeline, not by memory.
Scan configuration in CIPolicy-as-code and IaC scanners catch public buckets and open security groups before deployment.
Security headers by defaultSet them centrally (middleware, reverse proxy, CDN) rather than per page.
Generic errors to users, detail to logsUsers get an error ID; engineers get the stack trace.
Regular external reviewPeriodically scan your own external attack surface — attackers do it continuously.
Segment architectureSeparate tiers and tenants with network rules and containers so one mistake doesn't expose everything.

Pro Notes​

  • Configuration drift is the silent killer. A server hardened at launch can be wide open six months later after "temporary" changes. Continuous compliance scanning against a benchmark (such as the CIS Benchmarks) catches drift.
  • CSP is configuration too. A Content Security Policy containing 'unsafe-inline' and 'unsafe-eval' exists on paper but blocks almost nothing. Prefer nonce- or hash-based policies.
  • Cloud IAM is the new perimeter. In cloud environments, an overly broad role is often a bigger risk than an open port. Review effective permissions, not just policy documents.
  • Shadow assets. Forgotten staging servers, old marketing microsites, and test subdomains are often the weakest configured — and the hardest to find without proper asset inventory.

Key Takeaways​

  • Misconfiguration means insecure settings around otherwise correct code — defaults, debug features, permissive cloud policies, missing headers.
  • It rose to #2 in 2025 because modern systems are mostly configuration, spread across many teams.
  • XXE now lives here: it's fixed by configuring XML parsers safely.
  • Automated, repeatable, minimal configuration — scanned in CI — is the core defence.

Go deeper: XML, XXE & Data-Format Attacks · Caching & Infrastructure Abuse


Next​

A03:2025 — Software Supply Chain Failures