OWASP Web Top 10 — A05

Security Misconfiguration

Security Misconfiguration occurs when security settings are not defined, implemented, or maintained properly. It can affect any level of an application stack, from frameworks and servers to databases and cloud services, exposing systems to attackers who exploit default credentials, unnecessary features, or verbose error messages.

What Is Security Misconfiguration?

Security Misconfiguration is a vulnerability that arises when security controls are improperly configured, left at default settings, or not configured at all. This category encompasses a wide range of issues including default credentials, unnecessary features enabled in production, verbose error messages that leak sensitive information, missing security headers, overly permissive cloud storage permissions, and incomplete or ad-hoc configurations. Unlike code-level vulnerabilities, misconfigurations often stem from operational oversights or insufficient security hardening practices.

The vulnerability is particularly dangerous because it can exist at any layer of the application stack: operating systems, web servers, application frameworks, databases, APIs, and cloud infrastructure. A single misconfiguration in any of these layers can compromise the entire system. Common examples include running applications in debug mode in production, leaving default admin accounts active, exposing administrative interfaces to the internet, failing to apply security patches, and granting excessive permissions to cloud resources.

Security Misconfiguration is ranked as A05 in the OWASP Top 10 2021 edition. The category was expanded from previous versions to include more types of misconfigurations, reflecting the growing complexity of modern application architectures and the increasing number of configuration options that developers and operations teams must manage. According to OWASP, 90% of applications were tested for some form of misconfiguration, with an average incidence rate of 4%, making it one of the most common vulnerabilities discovered in security assessments.

How It Works

1
Application or infrastructure is deployed

A web application, server, database, or cloud service is deployed with default settings or without proper security hardening. This could be a production server running with debug mode enabled, a cloud storage bucket created with default permissions, or an application deployed with sample accounts still active.

2
Security controls are missing or improperly configured

Critical security features remain disabled or misconfigured. Examples include missing HTTP security headers (CSP, HSTS, X-Frame-Options), directory listing enabled on web servers, unnecessary services running (admin panels, sample applications), or cloud resources configured with overly permissive access policies.

3
Attacker discovers the misconfiguration

Through automated scanning, manual testing, or simple browsing, attackers identify the weak configuration. They might find verbose error messages that reveal stack traces, discover default credentials that were never changed, locate exposed administrative interfaces, or find publicly accessible cloud storage buckets.

4
Attacker exploits the misconfiguration

With the misconfiguration identified, the attacker exploits it to gain unauthorized access or information. This could involve logging in with default credentials, extracting sensitive information from verbose error messages, accessing files through directory listing, or reading data from misconfigured cloud storage.

5
System is compromised

The attacker leverages the initial foothold to escalate privileges, move laterally through the network, exfiltrate sensitive data, or maintain persistent access. What began as a simple misconfiguration can lead to complete system compromise if the attacker combines multiple weaknesses or uses the initial access to discover additional vulnerabilities.

Vulnerable Code Example

Vulnerable — Java / Spring Boot
# application.properties

# VULNERABLE: Debug mode enabled in production
# Exposes sensitive debugging information
debug=true
spring.devtools.restart.enabled=true

# VULNERABLE: Verbose error messages
# Stack traces reveal internal implementation details
server.error.include-stacktrace=always
server.error.include-message=always
server.error.include-binding-errors=always

# VULNERABLE: Default credentials
spring.security.user.name=admin
spring.security.user.password=admin

# VULNERABLE: No security headers configured
# Missing CSP, HSTS, X-Frame-Options, etc.

# VULNERABLE: Unnecessary endpoints exposed
management.endpoints.web.exposure.include=*
management.endpoint.shutdown.enabled=true

# VULNERABLE: CORS allows all origins
spring.web.cors.allowed-origins=*
spring.web.cors.allowed-methods=*

# Attackers can:
# 1. Access /actuator/shutdown to shut down the app
# 2. View detailed stack traces to map internal structure
# 3. Log in with default admin/admin credentials
# 4. Execute XSS attacks due to missing CSP header
# 5. Access sensitive endpoints from any origin

Secure Code Example

Secure — Java / Spring Boot (Hardened Configuration)
# application.properties

# SECURE: Debug mode disabled in production
debug=false
spring.devtools.restart.enabled=false

# SECURE: Generic error messages only
# No stack traces or implementation details exposed
server.error.include-stacktrace=never
server.error.include-message=never
server.error.include-binding-errors=never

# SECURE: Strong credentials from environment variables
# No default credentials in configuration
spring.security.user.name=${ADMIN_USERNAME}
spring.security.user.password=${ADMIN_PASSWORD}

# SECURE: Security headers configured
# Implemented via SecurityConfig class
# CSP, HSTS, X-Frame-Options, X-Content-Type-Options

# SECURE: Only expose necessary endpoints
# Sensitive endpoints require authentication
management.endpoints.web.exposure.include=health,info
management.endpoint.shutdown.enabled=false

# SECURE: Restrictive CORS configuration
spring.web.cors.allowed-origins=https://trustedapp.example.com
spring.web.cors.allowed-methods=GET,POST
spring.web.cors.allow-credentials=true

# Additional security measures:
# - Regular security audits
# - Automated configuration scanning
# - Principle of least privilege applied
# - All unnecessary features disabled

Types of Security Misconfiguration

Default Credentials & Settings

One of the most common and easily exploited misconfigurations. Systems shipped with default usernames and passwords (admin/admin, root/password) that are never changed in production. This includes default database credentials, administrative accounts, API keys, and service credentials. Attackers maintain extensive databases of default credentials and automated tools to test them. Additionally, sample applications and demonstration content left active on production servers provide unnecessary attack surface and often contain known vulnerabilities.

Missing Security Headers & Hardening

Web applications that fail to implement critical HTTP security headers such as Content Security Policy (CSP), HTTP Strict Transport Security (HSTS), X-Frame-Options, X-Content-Type-Options, and Referrer-Policy. These headers provide essential defenses against cross-site scripting, clickjacking, and other client-side attacks. Other hardening failures include directory listing enabled on web servers (allowing attackers to browse file structures), verbose error messages that expose stack traces and internal paths, unnecessary HTTP methods enabled (PUT, DELETE, TRACE), and failure to disable or secure administrative interfaces.

Cloud & Infrastructure Misconfiguration

Particularly dangerous in modern cloud-native applications. Common issues include publicly accessible storage buckets (AWS S3, Azure Blob Storage, Google Cloud Storage) containing sensitive data, overly permissive IAM policies granting excessive privileges to services or users, exposed management ports and consoles (SSH on port 22, RDP on 3389, Kubernetes dashboards, database admin panels), security groups and firewall rules allowing unrestricted access (0.0.0.0/0), and missing encryption for data at rest or in transit. Cloud misconfigurations have been the root cause of some of the largest data breaches in recent years.

Impact

Security misconfigurations can have severe consequences depending on what is exposed and how it is exploited. The impact ranges from information disclosure to complete system compromise.

Unauthorized access and data breaches

Misconfigurations such as default credentials, exposed administrative interfaces, or publicly accessible cloud storage can give attackers direct access to sensitive data, user accounts, or entire systems. This can result in massive data breaches exposing customer information, financial records, intellectual property, and confidential business data.

Information leakage

Verbose error messages, debug modes, and exposed configuration files can reveal critical information about the system architecture, technology stack, file paths, database structure, and even credentials. Attackers use this information to plan more sophisticated attacks, identify other vulnerabilities, and map the internal network.

Complete system compromise

In severe cases, misconfigurations can lead to remote code execution or complete server takeover. Exposed management endpoints, unnecessary services, or overly permissive cloud IAM roles can be leveraged by attackers to gain shell access, install backdoors, pivot to other systems, or execute arbitrary commands on the server.

Compliance violations and reputational damage

Security misconfigurations often violate industry standards and regulatory requirements (PCI DSS, HIPAA, GDPR, SOC 2). A breach resulting from a misconfiguration can lead to significant fines, legal liability, loss of customer trust, and long-term reputational damage. Organizations may also face increased scrutiny from regulators and mandatory security audits.

Prevention Checklist

Implement a repeatable hardening process

Develop and document a standardized process for hardening all environments (development, staging, production). Use configuration management tools like Ansible, Chef, or Puppet to ensure consistent security configurations across all systems. Automate hardening steps wherever possible to reduce human error and ensure configurations are applied uniformly.

Minimize platform and framework features

Apply the principle of least functionality. Remove or disable all unnecessary features, services, frameworks, documentation, and sample applications. Disable debug modes, verbose error messages, and development tools in production. Only enable the minimal set of features required for the application to function. Regularly review enabled features to ensure nothing unnecessary is running.

Implement comprehensive security headers

Configure all necessary HTTP security headers including Content Security Policy (CSP), HTTP Strict Transport Security (HSTS), X-Frame-Options, X-Content-Type-Options, and Referrer-Policy. Test header configurations using tools like securityheaders.com. Implement headers at the web server or application framework level to ensure they are present on all responses.

Regular security configuration reviews and scanning

Conduct periodic reviews of security configurations across all infrastructure layers. Use automated tools like AWS Config, Azure Security Center, OpenSCAP, or CIS-CAT to scan for configuration weaknesses and deviations from security baselines. Implement continuous compliance monitoring to detect configuration drift. Review cloud permissions, network rules, and access policies regularly.

Segment application architecture

Use network segmentation, containerization, and cloud security groups to isolate components. Implement defense-in-depth so that a misconfiguration in one component does not compromise the entire system. Use separate accounts or subscriptions for different environments (dev, staging, prod). Apply the principle of least privilege to all service accounts, IAM roles, and network access rules.

Automate configuration verification in CI/CD

Integrate security configuration checks into your CI/CD pipeline. Use infrastructure-as-code (IaC) scanning tools like Checkov, Terraform Sentinel, or CloudFormation Guard to validate configurations before deployment. Fail builds that contain security misconfigurations. Implement automated testing to verify security headers, disabled debug modes, and proper error handling in each deployment.

Real-World Examples

2019

Capital One Data Breach

A misconfigured web application firewall (WAF) allowed an attacker to exploit a Server-Side Request Forgery (SSRF) vulnerability. Combined with overly permissive IAM roles, the attacker accessed over 100 million customer credit applications and accounts from misconfigured AWS S3 buckets. The breach resulted in an $80 million fine and cost Capital One approximately $270 million in total.

2021

Microsoft Power Apps Data Leak

Misconfigured data access controls in Microsoft Power Apps portals exposed over 38 million records from organizations including American Airlines, Ford, and state governments. The issue stemmed from a default configuration that made OData API endpoints publicly accessible without authentication. The exposure included COVID-19 contact tracing data, employee records, and vaccination appointment information.

2018

Tesla Kubernetes Breach

Attackers discovered an unsecured Kubernetes console (administrative dashboard) that was publicly accessible without password protection. The attackers used this access to deploy cryptocurrency mining software on Tesla's cloud infrastructure. While the breach was primarily used for crypto-mining, the attackers had access to sensitive data including Tesla proprietary information stored in AWS S3 buckets.

2016

Uber GitHub Credential Leak

Uber developers accidentally committed AWS credentials to a private GitHub repository. Attackers who gained access to the repository used these credentials to access Uber's AWS account and download data from misconfigured S3 buckets containing personal information of 57 million users and drivers. Uber paid $148 million in settlements to all 50 U.S. states and Washington, D.C., primarily for concealing the breach.

Ready to Test Your Knowledge?

Put what you have learned into practice. Try identifying and fixing Security Misconfiguration vulnerabilities in our interactive coding challenges, or explore more security guides to deepen your understanding.