GraphNode
Back to OWASP Top 10 hub
OWASP A05

OWASP A05:2021 Security Misconfiguration: Detection and Prevention

| 11 min read |GraphNode Research

TL;DR

Security Misconfiguration is the fifth-ranked risk in the OWASP Top 10 (2021). The category covers default credentials left in place, unnecessary features enabled, missing security headers, verbose error messages that leak stack traces, outdated software stacks, and exposed admin or debug endpoints. It is unusual among the Top 10 because the defects live across three distinct surfaces — application code, runtime configuration, and cloud infrastructure — so no single tool catches all of it. SAST handles the code-level subset (hardcoded debug flags, missing security header setup, verbose error handlers); DAST verifies runtime headers and exposed endpoints; IaC scanning addresses the cloud-infrastructure layer.

Security misconfiguration is the OWASP category most in flux. Part of it is code, part of it is runtime configuration, and a growing part of it is cloud infrastructure that no source-code scanner ever sees. The "exposed S3 bucket" headline of the 2010s and the "default Kubernetes dashboard" of the 2020s share the same root cause: a system was deployed without anyone explicitly asking what its default posture looked like, what it exposed to the internet, or what credentials it shipped with. The defect lives in the gap between "the software works" and "the software is hardened."

A05:2021 moved up from sixth place in the 2017 edition, reflecting OWASP's data showing a roughly 4 percent incidence rate across tested applications and a rising contribution from cloud-native deployments. The category aggregates 20 underlying CWEs in the official mapping, ranging from CWE-16 (Configuration) through CWE-942 (Permissive Cross-domain Policy). This guide explains what the category covers, the patterns it shows up as, the most relevant CWEs, real-world incidents, and the layered detection strategy — SAST plus DAST plus IaC scanning — that actually works in 2026.

What Security Misconfiguration Covers

Security misconfiguration is the failure to lock down a system to a secure baseline. The OWASP definition is intentionally broad because the defects span every layer of the stack — operating system, web server, application framework, cloud platform, container runtime, identity provider — and the unifying theme is that the system is reachable, functional, and dangerous because nobody explicitly configured it to be safe.

Default credentials are the headline subset. Database admin accounts left at admin/admin after deployment, router web interfaces with vendor-default passwords, framework dashboards with the example credentials from the README, and cloud service accounts with provider-default keys are all in scope. The Mirai botnet of 2016 industrialized this pattern, conscripting hundreds of thousands of internet-facing devices that still shipped with their factory passwords.

Unnecessary features enabled covers sample applications shipped to production, demo accounts that were never disabled, debug endpoints reachable from the internet, and management consoles bound to public network interfaces instead of localhost. Spring Boot Actuator endpoints exposing JVM internals, PHP info.php pages disclosing the full configuration, and Tomcat manager applications bound to the same port as the public application are recurring examples.

Missing security headers are the HTTP-layer subset. X-Frame-Options and Content-Security-Policy mitigate clickjacking and XSS; Strict-Transport-Security enforces HTTPS; Referrer-Policy controls outbound referrer leakage. When these headers are absent, the browser defaults are permissive, and the application inherits the weakest available posture.

Verbose error messages leak internals. A 500 error page that returns the full stack trace, including framework version, file paths, and SQL queries, hands an attacker the reconnaissance they would otherwise have to perform actively. Outdated software components in the platform layer — unpatched web server, expired TLS certificates, deprecated cipher suites, unpatched OS packages — round out the category, alongside exposed admin interfaces reachable without an authentication challenge and missing CORS controls that allow arbitrary origins to invoke authenticated APIs.

Common Patterns

Default admin/admin still in production. The system was set up by an engineer who intended to come back and rotate the password, then never did. The credentials sit in the configuration management system, in a wiki page from 2019, and on the deployed instance — searchable from any internal terminal and frequently from the internet.

Debug=True in production. Django's DEBUG = True and Rails' equivalent enable rich error pages with full stack traces, SQL queries, and framework internals. They are invaluable in development and disastrous in production. The pattern shows up wherever a settings file was committed without environment branching, or where a deployment pipeline failed to override the development default.

Stacktrace error pages reaching users. An unhandled exception in a controller propagates to the framework's default error handler, which renders the trace into the response. The attacker submits malformed input deliberately to trigger errors and harvests version numbers, file paths, and dependency information from the resulting page.

Missing X-Frame-Options, CSP, HSTS, Referrer-Policy. The application loads in iframes (clickjacking), accepts inline scripts (XSS amplification), permits HTTP downgrade (cookie theft), and leaks full URLs to third-party referrers. Each missing header narrows the browser's defenses by one layer.

Exposed Spring Boot Actuator endpoints. The /actuator/env, /actuator/heapdump, and /actuator/loggers endpoints disclose environment variables (often containing credentials), full memory dumps, and runtime log levels. Default Spring Boot configurations exposed these without authentication for years; the modern defaults are stricter, but legacy services still ship them open.

MongoDB no-auth. Pre-3.6 MongoDB shipped with authentication disabled and bound to all interfaces by default. Tens of thousands of internet-facing instances were discovered and ransomed in 2017 because the default posture combined "open to the world" with "no password required."

Kubernetes dashboards reachable from the internet. The dashboard's default service account historically held cluster-admin privileges. Exposing the dashboard to a public load balancer without authentication grants any visitor full control of the cluster — schedule pods, mount secrets, exfiltrate workloads.

SSO with permissive default redirect URIs. An OAuth or OIDC client configured to accept any redirect URI matching a wildcard pattern lets an attacker craft a login flow that delivers the access token to a domain they control. The defect is the trust the authorization server places in the client's registered redirect URI list.

Real-World Incidents

MongoDB unsecured databases (2017). Researchers and attackers discovered tens of thousands of internet-facing MongoDB instances running with the default no-authentication configuration, bound to all network interfaces. A wave of ransomware attacks dropped databases and demanded payment for the data's return. The root cause was a pre-3.6 MongoDB default that combined "no password required" with "listening on every interface" — a configuration choice the operator never explicitly made and never explicitly fixed.

Tesla Kubernetes cluster takeover (2018). Researchers reported that a Tesla-operated Kubernetes administration console was reachable from the public internet without an admin password set. Attackers used the open dashboard to access cloud credentials stored as Kubernetes secrets and ran cryptocurrency mining workloads inside the cluster. The defect was a Kubernetes management interface deployed without the authentication step the operator assumed was on by default.

Capital One (2019). The breach that exposed roughly 100 million records combined a misconfigured web application firewall with an SSRF vulnerability and an over-permissive IAM role. The misconfigured WAF allowed the SSRF to reach the AWS instance metadata endpoint; the over-permissive role attached to the host then allowed exfiltration of S3 buckets. The misconfiguration layer was the entry point that turned a single application bug into a 100-million-record incident.

Microsoft exposed Azure database (2020). A Microsoft-operated support case database was reportedly left publicly accessible with no authentication for a period in late 2019 and early 2020 due to a misconfigured network rule. Roughly 250 million records of customer service interactions were exposed. The defect was a configuration change to a security rule that opened the dataset to the public without the operator realizing it.

Relevant CWE Mappings

A05:2021 aggregates 20 underlying CWEs in the official OWASP mapping. The six below are the most common in practice and the ones most teams will recognize from scanner output and finding tickets.

CWETitleWhere It Shows Up
CWE-16ConfigurationCatch-all for missing or insecure configuration that lacks a more specific mapping
CWE-260Password in Configuration FilePlaintext credentials stored in a settings file shipped with the application
CWE-526Cleartext Storage of Sensitive Info in Environment VariableSecrets exposed via process environment, readable by any code in the same process
CWE-547Use of Hard-coded, Security-relevant ConstantsCritical security values baked into source rather than read from a managed source
CWE-756Missing Custom Error PageDefault framework error handler returning stack traces and internals to users
CWE-942Permissive Cross-domain Policy with Untrusted DomainsCORS or crossdomain.xml allowing arbitrary origins to invoke authenticated APIs

CWE-16 is the umbrella the others descend from when a finding does not fit a more specific entry. CWE-260 and CWE-526 are the two most likely to appear in SAST output, because they are visible at the source level. CWE-756 is the one that produces verbose error pages in production. CWE-942 covers the permissive CORS subset that DAST and runtime header checks catch most reliably.

Detection: Where SAST, DAST, and IaC Scanning Each Help

Security misconfiguration is the OWASP category most clearly split across three detection layers. The defects live in code, in runtime configuration, and in cloud infrastructure, and no single tool sees all three. A complete program runs all three layers and treats them as complementary rather than redundant.

SAST is the right layer for the code-level subset of misconfiguration. Static analysis can flag hardcoded debug flags (DEBUG = True, RAILS_ENV = "development" in production-bound code paths), hardcoded credentials in configuration files committed to source, missing security header configuration in framework setup code (no CSP middleware registered, no HSTS configured at the gateway layer in code), and verbose error handlers that re-render exceptions into responses without sanitization. GraphNode SAST traces these patterns across method boundaries and surfaces them at the source location, so the developer fixing the configuration sees the file and line that needs to change.

DAST is the layer that confirms runtime exposure. A dynamic scanner probing a deployed application can verify which security headers the server actually sends, which admin or debug endpoints respond, whether default credentials are accepted, whether verbose error pages render to anonymous requests, and whether CORS is configured permissively. SAST cannot tell you whether the deployed application enforces a header that the source code claims to set; only DAST against the running instance can confirm it.

IaC scanning addresses the cloud-infrastructure layer that neither SAST nor DAST sees. Terraform, CloudFormation, Helm charts, and Kubernetes manifests describe the infrastructure as code, and dedicated IaC scanners flag misconfigurations before deployment: public S3 buckets, security groups open to 0.0.0.0/0, IAM policies with wildcard actions, Kubernetes pods running as root with the host network namespace, and so on. For the full mechanics see IaC scanning explained. The IaC layer is what closes the gap on cloud-native A05 incidents like the MongoDB and Tesla cases above.

Prevention

Hardened secure-by-default platform images. Build a base image — VM, container, AMI, whatever the deployment target is — that ships hardened: no default accounts, no sample applications, only required services running, security headers configured at the gateway layer, debug flags off. Every workload starts from that image, which collapses the surface area where a forgotten default could persist.

Infrastructure-as-code with policy gates. Define cloud infrastructure declaratively in Terraform or equivalent, then run a policy engine — Open Policy Agent, Conftest, Checkov — against the IaC files in CI. The pull request that proposes a public S3 bucket fails the policy check before the bucket exists. The pattern moves misconfiguration detection left of deployment, where the cost of fixing is minutes rather than days.

Pod Security Standards in Kubernetes. Kubernetes ships Pod Security Standards (Baseline, Restricted) that enforce minimum security postures for workloads — no privileged containers, no host network, no host PID, no root filesystem write. Enable the admission controller and require the Restricted profile for all workloads except the small set that genuinely need elevated privileges.

Automated security header injection. Apply security headers (CSP, HSTS, X-Frame-Options, Referrer-Policy) at the gateway or CDN layer rather than in each application. A single configuration in the edge layer guarantees every downstream service inherits the same baseline, even when an individual service forgets.

Environment-specific secrets management. No production credentials in code, no production credentials in committed configuration files, no production credentials in environment variables baked into container images. Use a managed secrets store (AWS Secrets Manager, HashiCorp Vault, Kubernetes external-secrets) with environment-scoped access. The dev key never works in prod and vice versa.

Error page templates that hide stack traces. Production error handlers render generic messages to users and log the full detail server-side. The pattern is usually a single framework switch — DEBUG = False plus a custom 500 template — but it has to actually be set, and tested, in every environment that is reachable from outside the perimeter.

Regular config drift audits. Even a perfectly hardened baseline drifts. Schedule recurring scans of deployed infrastructure against the baseline definition and alert on any divergence. CSPM tools formalize this for cloud accounts; equivalent processes exist for Kubernetes (kube-bench), container images (Trivy), and host operating systems (CIS benchmarks).

Where GraphNode SAST Fits

GraphNode SAST covers the code-level subset of A05 directly. It flags hardcoded debug flags shipped into production code paths, hardcoded credentials and API keys committed to source, missing security header configuration in framework setup (no CSP middleware registered, no HSTS configured), and verbose error handlers that render full exception detail into responses. Hardcoded secret detection is a specifically called-out capability in the GraphNode SAST feature set, alongside the broader 780+ rule pack covering OWASP Top 10 and CWE mappings.

What SAST cannot do for this category is verify the runtime posture of a deployed system or audit cloud infrastructure that does not appear in application source. A finding that the code registers a CSP middleware does not prove the deployed instance actually serves the header; that confirmation belongs to DAST. A finding that the application reads a database password from an environment variable does not tell you whether the cloud secrets manager that supplies the variable is configured correctly; that belongs to IaC scanning and CSPM. The honest position is that GraphNode SAST is the right layer for the code-level slice of A05 and one part of a layered program that pairs it with DAST and IaC scanning.

Frequently Asked Questions

What is security misconfiguration?

Security misconfiguration is the failure to deploy a system with a hardened, secure-by-default posture. It covers default credentials left in place, unnecessary features and sample applications enabled in production, missing security headers, verbose error messages that leak stack traces, outdated software stacks, exposed admin or debug endpoints, default permissions that are too permissive, and missing CORS controls. It is the fifth-ranked risk in the OWASP Top 10 (2021), having moved up from sixth in 2017.

Is misconfiguration a code or infrastructure problem?

Both, which is what makes A05 unusual. The category aggregates defects that live in application source (hardcoded debug flags, missing security header setup, verbose error handlers), runtime configuration of the deployed application (missing headers actually served, exposed admin endpoints), and cloud infrastructure (public S3 buckets, permissive security groups, exposed Kubernetes dashboards). A complete A05 program treats all three as in scope and runs the appropriate scanner against each layer rather than expecting one tool to cover everything.

Can SAST detect security misconfiguration?

SAST detects the code-level subset, not the full category. Static analysis is well positioned to flag hardcoded debug flags like DEBUG = True in production-bound code paths, hardcoded credentials and API keys in configuration files, missing security header setup in framework code (no CSP or HSTS middleware registered), and verbose error handlers that re-render exceptions into responses. SAST cannot verify which headers the deployed server actually serves, which endpoints are reachable from the public internet, or whether cloud infrastructure is configured securely. Those layers require DAST and IaC scanning respectively.

What is the difference between A05 and IaC scanning?

A05 Security Misconfiguration is the OWASP risk category — it names the class of weakness. IaC scanning is one of the detection techniques that addresses part of that category, specifically the cloud-infrastructure subset. IaC scanners parse Terraform, CloudFormation, Helm, and Kubernetes manifests and flag misconfigured resources (public S3 buckets, wildcard IAM policies, pods running as root) before deployment. IaC scanning sits alongside SAST (for the code-level subset) and DAST (for the runtime subset) as one of three layers that together address A05 end-to-end.

How do I find exposed admin endpoints?

The most reliable approach is DAST with a wordlist of common admin and debug paths — /admin, /actuator, /debug, /console, /swagger, /internal, /management — probed against the deployed application. Combine with external attack surface management tools that enumerate all internet-facing services and ports for the organization. Manual review of the route table or controller annotations during code review can catch admin endpoints at the source level, and SAST can flag endpoints that lack authorization annotations consistent with their siblings, but runtime probing is what confirms whether an endpoint is actually reachable and unauthenticated.

Catch Code-Level Misconfigurations Before They Ship

GraphNode SAST flags hardcoded debug flags, credentials in source, missing security header setup, and verbose error handlers across 13+ languages with deep interprocedural data flow analysis.

Request Demo