Skip to main content
Security guideReviewed

Security misconfiguration: when the software is sound and a setting leaves it open

A security misconfiguration is a weakness in a setting, not in the code: debug mode left on, a default account that still signs in, a folder that lists its files, an admin page or a storage bucket open to everyone.

This guide explains why those settings drift between development, staging and production, what each one exposes, and how to compare what you intended with what is running. It comes with an environment drift worksheet and a lab you can run on your own computer.

Environment drift worksheet and drift lab

Part 1 is a worksheet with ten rows, from debug mode to security headers: the expected production value and its source, how to observe the real value from outside and in the configuration, and spaces for development, staging, production, an owner and the evidence. Parts 2 and 3 are an illustration you can run with Node.js and no installs: one invented app started from three configuration files, a drift checker, a probe and a regression test, with every output copied from one recorded run on Node.js 26.0.0.

How to use it

Part 4 lists the same checks for your own application.

security-misconfiguration.txt

Introduction15 lines

ENVIRONMENT DRIFT WORKSHEET AND DRIFT LAB ILLUSTRATION ONLY. Part 1 is a worksheet for your own application. Parts 2 and 3 are a lab: an invented application, Fixture Bookings, with invented settings, owners, reasons and data, written for this page and run on one computer. Nothing in it is a client's system or a client's result, and it does not show how any real framework, web server or cloud service behaves. Its debug page, directory listing, error output and admin page are the lab's own. What it shows is a way to compare settings and a way to look from outside. The lab has one account, setup-admin, with the password invented-lab-password-not-real. Both were made up for this page and are no product's default. Use what the lab teaches only on systems you own or are authorised in writing to test. WHAT THE LAB NEEDS Node.js. Apart from each other, the scripts import only node:assert/strict, node:child_process, node:crypto, node:fs, node:http, node:path, node:test, node:timers/promises and node:url, and the lab installs no packages. The run in Part 3 was recorded on macOS with Node.js 26.0.0, the only version and the only system it was run on. Process ids, timings and the error reference differ from run to run. WHAT THE LAB DOES NOT DO Every instance listens on 127.0.0.1, on a port the system picks, and no port is printed. The app's "files" and "storage" folders are short lists inside app.mjs, so it serves nothing from your disk. The app writes only to a lab-state folder inside the lab folder, and set-production.mjs writes config/production.json. No request leaves your computer. Instances run in the background and are stopped by the process id each one recorded when it started, never by name. The operator token each instance makes when it starts is random and is never printed. WHAT IS HERE Part 1 The environment drift worksheet: ten rows to fill in for your own application Part 2 The lab files: fourteen files Part 3 The recorded run: fifteen commands and what each printed Part 4 The same checks on your own application

What a security misconfiguration is

A security misconfiguration is a weakness that lives in a setting rather than in the code.

The software does what it was built to do, and a switch, a permission, a leftover account or a forgotten file leaves it open: debug mode still on, a folder that lists its own contents, an admin page anyone can load, a storage bucket shared with the whole internet. Nothing has to be rewritten to fix it. A setting changes, an account is removed, a port is closed.

The OWASP Top 10:2025 gives it a category of its own, A02 Security Misconfiguration, and defines it as a system, application or cloud service that is set up incorrectly from a security perspective, creating vulnerabilities. The same page says the category moved up from fifth place in the previous edition, and that 100% of the applications tested were found to have some form of misconfiguration, with an average incidence rate of 3.00%.

Its explanation is brief: with more shifts into highly configurable software, it is not surprising to see this category moving up.

A02 lists eight signs that an application might be vulnerable. They include unnecessary features that are enabled or installed, for which it gives unnecessary ports, services, pages, accounts, testing frameworks and privileges as examples; default accounts and their passwords still enabled and unchanged; error handling that reveals stack traces or other overly informative error messages to users; improperly configured permissions on cloud services; and a server that does not send security headers or directives, or does not set them to secure values.

After the list, the description adds a sentence worth keeping in view: without a concerted, repeatable application security configuration hardening process, systems are at a higher risk.

The category is wide because settings are everywhere. A02 maps sixteen CWE weaknesses to it, and several have guides of their own in this library: CWE-614, Sensitive Cookie in HTTPS Session Without 'Secure' Attribute; CWE-1004, Sensitive Cookie Without 'HttpOnly' Flag; CWE-942, Permissive Cross-domain Policy with Untrusted Domains; CWE-611, Improper Restriction of XML External Entity Reference; and CWE-776, Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion').

On this page's reading, each is a setting someone left more open than the application needed. This page takes the idea they share, and the cases no other guide owns: the gap between the settings a team tested and the settings production is running, default accounts and sample content, debug and diagnostic routes, directory listings, verbose errors, admin interfaces and services reachable from the internet, and storage that is public by setting.

How OWASP's testing guide and ASVS cover configuration

Two OWASP documents turn the category into things a team can check.

Version 4.2 of the Web Security Testing Guide (WSTG) has a chapter of eleven tests, 4.2 Configuration and Deployment Management Testing. Version 5.0 of the Application Security Verification Standard (ASVS) has a chapter of requirements, V13 Configuration, whose control objective opens with one sentence: the application's default configuration must be secure for use on the Internet.

The testing guide's configuration tests

These are the tests this page draws on, each with the id and name version 4.2 gives it. 1 min read

ASVS 5.0, V13.4 Unintended Information Leakage

Section V13.4 holds seven requirements, each with a level from 1 to 3. 1 min read

How much these settings are worth

The standard is candid about that. 1 min read

Why misconfiguration happens between environments

Take an application that runs in three places: a developer's machine, a staging copy where changes are tried, and production.

Each place has its own copy of the settings. Environment drift is the gap between those copies, and above all between the settings the team tested and the settings production is running.

Drift has two ordinary sources. The first is convenience. Development settings exist to make building easier, and the frameworks say so themselves. Django 6.1's documentation gives the default of its DEBUG setting as False and says never to deploy a site into production with DEBUG turned on, then notes that the default settings.py file created by django-admin startproject sets DEBUG = True for convenience.

Its deployment checklist describes some of Django's security features as optional because they are not always appropriate, or because they are inconvenient for development, and says the checklist includes settings that are expected to be different in each environment.

Express documents the same split from the other side. The Express 5.x API reference gives the default of its env setting as the NODE_ENV environment variable, or "development" if NODE_ENV is not set, and tells readers to be sure to set it to "production" in a production environment.

On this page's reading, a production server whose host never set that variable is running an application that believes it is on a developer's machine.

The testing guide names the mechanism. In its guidance on reviewing a server's configuration, WSTG-CONF-02 says to make sure that application errors are not returned to the end user and that no code is leaked through them, and adds that it is actually very common to forget this point since developers do need this information in pre-production environments.

The second source is a change made under pressure. During an outage someone turns on verbose errors to see what is failing, opens an admin port to reach a server, or makes a storage bucket public so one file can be fetched, and the incident ends before the setting is put back.

Nothing records that production now differs from what was tested, and the next release ships on top of it.

The first item in A02's prevention list is a repeatable hardening process. It says development, QA and production environments should all be configured identically, with different credentials used in each, and that the process should be automated to minimise the effort required to set up a new secure environment.

The same list includes an automated process to verify the effectiveness of the configurations and settings in all environments. Where environments do differ, each difference should be a decision that someone made and wrote down. The lab on this page works that way: its development file differs from the intended production values in all ten settings, each with a written reason, its staging file differs in one, and its careless production file differs in six, with no reason for any of them.

Two gaps a file comparison cannot see

The first is between the file and the running process. An application that reads its settings when it starts keeps them until it starts again. In the lab, replacing the careless production file with the careful one made the file comparison pass at once, while the instance that was already running went on serving its debug page, its listing and its open admin page until it was restarted.

The second is between one layer and another. A request can be answered by a CDN, a web server or the application, and a setting applied in one layer is absent when another layer answers. nginx's documentation gives a concrete case. Its add_header directive adds a field only when the response code is one of the ten it lists, from 200 to 308, unless the always parameter is given.

Its add_header directives are also inherited from the previous configuration level if and only if there are none defined on the current level, a rule the add_header_inherit directive, from nginx 1.29.3, can change.

On this page's reading, a header set once at the top of a configuration can be missing from an error page, or from a location that sets one header of its own.

Security misconfiguration examples, and what each one exposes

Each example below is one row of the worksheet on this page.

Where a product's default is given, it comes from that product's own documentation as it read on 14 November 2026, and it says nothing about any other product. The version is named where the documentation page gives one.

Two of the pages do not say which version they describe: nginx's page for its autoindex module and the Amazon S3 User Guide page on blocking public access. Those two defaults carry only that date.

Debug mode exposure

Debug mode is a framework's promise to tell the developer everything, and it keeps that promise to whoever sends the request. 1 min read

Default credentials and sample content

A product may arrive with an account already in it, so that someone can sign in and finish the installation, and its documentation may give that account's credential. 2 min read

Directory listings

A directory listing is a web server's answer to a request for a folder that has no index page: instead of an error, a list of every file in it. nginx's documentation for its autoindex module says the module processes requests ending with the slash character and produces a directory listing, and gives the default as autoindex off. 1 min read

Verbose error output

WSTG-ERRH-01 lists stack traces among the forms an application's errors take. 2 min read

Administrative interfaces reachable from the internet

An admin interface is where accounts are created, content is changed and settings are edited. 1 min read

Unnecessary services and HTTP methods

Anything that is running and not needed is surface that nobody is watching. 2 min read

Monitoring and documentation endpoints

Status pages, metrics endpoints and API documentation are built for the team, and ASVS 5.0 requirement 13.4.5 asks that they are not exposed unless explicitly intended. 1 min read

Source maps in production

MDN's glossary describes a source map as a JSON file format that maps between minified or transformed code received by the browser and its original unmodified form, allowing the original code to be reconstructed and used when debugging. 1 min read

Cloud security misconfiguration: storage that is public by setting

Cloud storage has no folder on a web server to forget about. 1 min read

Security headers set in one layer only

A02's last sign is a server that does not send security headers or directives, or does not set them to secure values. 1 min read

How to find drift: compare what you intended with what is running

Drift is a difference, so finding it takes two things to compare.

The running system is one. The other is a written statement of what production is supposed to be, and that is the one to create first.

  • Write down the intended production value of every setting that changes what a stranger can reach. The worksheet's ten rows are a starting list. In the lab this is one file, expected-production.json, with a value and an owner for each setting.
  • Compare each environment's configuration with it. The lab's drift-check.mjs does this for its three files and reports every difference. On the careless production file it reported six, each with the owner to ask.
  • Decide each difference. In development and staging, a difference can be accepted in writing, with a reason. In production it is drift by definition, because the expected values describe production. A difference nobody can explain is a finding.
  • Look from outside. Request the observable items from the running system and compare the answers with what the intended settings would give. The lab's probe.mjs does this for all three instances.
  • Fix the setting where it is defined, restart or redeploy whatever read it, and look from outside again.

Why the last step is not a formality

In the recorded run, the production file was replaced with the careful version and the file comparison reported no drift. The regression test, run straight afterwards, still failed six checks, all of them against the running instance: it had loaded the careless settings when it started and was still serving them.

Only after the instance was restarted did the outside checks pass. A review that had stopped at the file would have passed a production system that still had a public debug page.

What an accepted difference costs

An accepted difference in staging is a behaviour that staging can no longer vouch for. The lab's staging file keeps its status endpoint public, with a written reason, so nothing tested there says whether production's status endpoint is closed. Only the production check does. Keep the list of accepted differences short for that reason, and read it before trusting a result from staging.

Keep each setting in one reviewed place

A value that lives in a dashboard, in an environment variable on one server, in a line of a deploy script and in a default in the code has no single answer to the question of what it is supposed to be, and no moment at which a second person sees it change.

This is the page's own advice rather than a quotation: give every setting that affects exposure one home that goes through review, such as a configuration file in the repository or an infrastructure definition, and have each environment's value come from it.

Two framework documents show a production value kept in a file. Django's deployment checklist describes publishing suitable settings for development and using a private settings module for production as a common practice when a project's source code is released, and says to run its automated check, the check --deploy option, against the production settings file.

Express's production guidance says environment variables are typically set in an interactive shell in development, but that in general you should not do that on a production server and should use the operating system's init system instead; its example puts NODE_ENV=production in a systemd unit file.

On this page's reading, a value kept in a file that way can be read, compared and reviewed.

  • Secrets are the exception to "in the repository": the value stays in the host's secrets store, and the reviewed file only names it. A02's prevention list ends with a related item: use identity federation, short-lived credentials or role-based access mechanisms provided by the underlying platform instead of embedding static keys or secrets in code, configuration files or pipelines.
  • Give each setting an owner, by role. The lab's expected-production.json names one for every setting, and the drift report prints it in its first table and again beside each difference that has no written acceptance.
  • Send emergency changes through the same file afterwards. If production was changed directly during an incident, the incident is not closed until the file says the same thing or production has been changed back.
  • Have the application refuse to guess. The lab's app stops when it starts if a setting is missing or has a value it does not know. In two separate trials, a file with a setting left out and a file with an unknown value each ended with an error naming the setting and exit code 1. Those two trials are not part of the recorded run the asset shows. A typing error in a setting's name then cannot quietly become a permissive default.

Check from outside as well as from the configuration

A configuration review reads what the settings say.

An outside check reads what the system does. They fail in different ways, so use both: the file can be right while the process is stale, a proxy or CDN in front can answer instead of the application, and a layer nobody thought to read can override the setting.

Run these checks only against hostnames you own or are authorised in writing to test, one request at a time, from a private browser window or a command-line HTTP client. Each line gives the answer a correctly configured server returns. The list is for checking your own property. It is not a method for finding other people's systems.

  • A debug or diagnostic path that your developer names: an error such as 404, with no settings, environment values or version details in the body.
  • A folder URL with no index page, such as an uploads or assets folder, ending in a slash: an error such as 403 or 404, and no list of file names.
  • A URL with a malformed value, such as letters where the application expects a number: a plain error page, with no stack trace, file path, query text or framework name.
  • Each admin path, requested from a network that is not your office or VPN, such as a phone on mobile data: no answer at all, or a sign-in page and nothing else.
  • The address of a stored file that should be private, opened while signed out: an access-denied error, not the file.
  • Your status, metrics and API documentation paths: an error, or only what you decided to publish.
  • The address of your main JavaScript file with .map added: an error such as 404, unless you chose to publish source maps.
  • A page that exists, a page that does not and an address that redirects, on each hostname: the same security headers on all three.

Read the body, and know what the check cannot tell you

Read the body as well as the status code. A page can answer 200 and show an error, and a custom error page can hide what the server underneath would have said. Keep each request, its answer and the date, because that record is the evidence column of the worksheet.

An outside check sees only the paths you tried, on the day you tried them, from the network you were on. It says nothing about a path nobody thought of or a setting that changes tomorrow, which is why the configuration comparison and the release check sit beside it.

Keep it checked after every release

A setting that was right at launch stays right only until the next change.

A02 asks for an automated process to verify the effectiveness of the configurations and settings in all environments, and says that where these verifications are not automated, they should still be carried out at least once a year.

The cheapest automation is a test that runs in the release pipeline. The lab's drift.test.mjs has twenty-one checks: ten read the production file against the expected values, ten ask the running production instance for the observable items, and one confirms that an operator can still reach the admin page.

Node.js's documentation says that if any tests fail, the process exit code is set to 1. A pipeline step that treats a non-zero exit code as a failure then stops the release.

On the careless configuration, twelve checks failed. After the file was fixed, six still failed until the instance was restarted. Then all twenty-one passed.

  • Before a release: the file comparison, against the production values the release will ship with.
  • After a release: the outside checks, against the live hostnames, once the new version is the one answering.
  • After any incident in which production was changed directly: both, before the incident is closed.
  • When a host, CDN, framework or server version changes: the defaults you rely on, because a default can change between versions. Apache's Options default did, in 2.3.11.
  • Where the framework has a check of its own, run it too. Django's documentation says some of its deployment checks can be automated with the check --deploy option, run against the production settings file.

What a test like this cannot do

It proves the settings it knows about. It does not find the setting nobody listed, which is why the worksheet has an owner for every row and why a new feature that changes what a stranger can reach adds a row before it ships.

Running the drift lab on your own machine

The lab on this page is an illustration: one invented application, Fixture Bookings, started three ways from three configuration files, with ten settings that follow the worksheet's ten rows.

It shows how to compare settings and how to look from outside. It does not show how any real framework behaves, and its debug page, listing and error output are the lab's own.

Apart from each other, the scripts import only modules whose names begin with node: and the lab installs no packages. Every instance is an HTTP server that listens on 127.0.0.1 and asks for port 0. Node.js's documentation says the HTTP server's listen() is identical to the one in its net module, where port 0 makes the operating system assign an arbitrary unused port.

The one account in the lab, setup-admin, has an invented password that is no product's default. The recorded run was made on Node.js 26.0.0 on macOS, the only version and the only system it was run on.

  • Steps 1 and 2 put the careless version in place as the production file and start three instances.
  • Step 3, the file comparison: ten accepted differences in development, one in staging and six with no acceptance in production, so the script exits with code 1.
  • Step 4, the probe: development answers differ from the intended production answer in all ten rows, staging in one and production in six.
  • Steps 5 and 6 print two production answers in full: the debug page, which lists every running setting, and the stack trace from the faulty route, with three lines cut on this page because they hold local file paths.
  • Step 7, the regression test: twelve of twenty-one checks fail.
  • Steps 8 to 10 replace the production file with the careful version. The file comparison passes and the test still fails six checks, because the running instance has not been restarted.
  • Steps 11 to 14 restart the production instance. All ten of its answers are then the intended ones, the faulty route returns one line with a reference, and all twenty-one checks pass.
  • Step 15 stops each instance by the process id it recorded when it started.

Pointing it at your own application

The files are small enough to adapt. Replace expected-production.json with your worksheet's rows, have drift-check.mjs read your own configuration files or an export of your host's environment settings, and rewrite observations.mjs so that each request goes to a hostname you own and each answer is read for the sign that matters on your stack. Keep the default-account observation pointed at a test installation, not at production.

Neighbouring guides, and where a Clever Ops check fits

Five pages in this library take the questions next to this one.

The sensitive data exposure guide covers personal and business data that a page, an API response, an export or a log gives to the wrong person. The secrets exposure guide covers API keys and other credentials in source, history, browser bundles and logs, and environment files or .git folders that a web server hands out.

The subdomain takeover guide covers DNS records left pointing at services you no longer hold.

The cookie security guide covers each Set-Cookie attribute and how to choose it. The website security audit page sets out the twelve checks Clever Ops runs on a live site from outside.

Clever Ops does not monitor sites and does not respond to incidents. If a misconfiguration has already been used against you, start with an incident response specialist. What Clever Ops offers is a check at a point in time, and each report records what was checked, on which hostnames and on which dates. A setting changed the day after is outside what the report can speak to.

  • The website security check looks from outside, without signing in. Among its twelve checks are hidden administrator interfaces and staging copies, old, backup and unreferenced files at paths the server will serve, the software versions a site reveals, the headers each hostname sends, and what error pages and debug output give away. It finds login screens but does not sign in or guess passwords, so default accounts are a check to make from the inside.
  • A web application and API penetration test adds the signed-in view. With read-only access to the code, its review can include checking production settings for debug modes against ASVS 5.0 requirement 13.4.2.
  • Internal networks are outside these services, and Clever Ops refers that work to a network specialist.
  • If Clever Ops built or hosts the site, the work is a security review rather than an independent test, and the report says who built it and who hosts it.

Frequently asked questions

It is a weakness that comes from a setting rather than from the code: debug mode left on, a default account still active, a folder that lists its files, or an admin page or storage bucket open to everyone. OWASP's Top 10:2025 defines it as a system, application or cloud service that is set up incorrectly from a security perspective, and lists it as A02, the second of its ten categories.

This guide works through ten: debug mode and debug routes, default accounts and sample content, directory listings, storage that is public by setting, verbose error output, admin interfaces reachable from the internet, unneeded services and HTTP methods, exposed monitoring or documentation endpoints, source maps served in production, and security headers set in one layer only. Each is a row in the worksheet on this page.

Because debug mode tells whoever makes the request what it was built to tell the developer. Django's documentation says its debug page shows a detailed traceback and metadata such as the currently defined settings, and that file paths, configuration options and the like all give attackers extra information about the server. ASVS 5.0 requirement 13.4.2 asks that debug modes are disabled for all components in production environments.

Start from the inside: compare the user list of each admin interface and database with the built-in accounts the product's documentation names, and look for empty password fields. If you also test from outside, try only the first-run account your product's own installation guide names, once, on your own installation. The OWASP testing guide warns that repeated guesses against a known user name may lock the account.

Anything enabled or listening that the application does not need: an open port, a server module, a sample application, a status page or an HTTP method such as TRACE. The OWASP testing guide says a list of the ports the application requires should be maintained and kept under change control, which gives you something to compare the running system with.

It is a cloud service or its storage set up so that more people can reach it than you intended. OWASP's Top 10:2025 lists improperly configured permissions on cloud services among the signs that an application might be vulnerable under A02, Security Misconfiguration. Amazon's S3 User Guide says new buckets, access points and objects do not allow public access by default, but that users can modify policies or permissions to allow it, and Amazon recommends turning on all four Block Public Access settings for the account. Check from outside by opening a private file's address while signed out.

On every release, by a test that fails the release when a production setting differs from its intended value, and again from outside once the release is live. OWASP's Top 10:2025 asks for an automated process to verify configurations and settings in all environments, and says that where the verification is not automated it should still be done at least once a year.

It finds what shows from outside without signing in: admin screens and staging copies, leftover files at paths the server serves, visible software versions, the headers each hostname sends and what error pages reveal. It does not sign in or guess passwords, and it works with no source code and no admin access, so default accounts, storage policies and server settings still need the inside comparison this guide describes.

Scope the right test for your application

Tell us what you have built, who uses it and when it needs to launch. You will get a plain-English recommendation: a website audit, a web application test or a referral to a specialist.