Difficulty: Beginner
What is a security misconfiguration? Give real examples and explain how teams prevent them.
A security misconfiguration is a vulnerability caused not by buggy code but by insecure settings: defaults left unchanged, debug features left on in production, overly permissive access rules, or missing hardening. Classic examples are default admin passwords, stack traces shown to users, a public S3 bucket or an internet-facing database with no authentication. It is a category in the OWASP Top 10 (A05 in the 2021 list, and it moved up to A02 in the 2025 edition) because it is extremely common and often trivial to exploit.
admin/admin on routers, Jenkins, Grafana, database consoles or IoT cameras.0.0.0.0 with no auth. Many large Indian and global data leaks have come from exactly this.DEBUG = True, Laravel debug pages, Express default error handler printing stack traces, exposing file paths, library versions and sometimes environment variables./actuator/env or /actuator/heapdump, phpMyAdmin, Kubernetes dashboard.db.sql.bak.Origin with Access-Control-Allow-Credentials: true.X-Content-Type-Options.0.0.0.0/0 on port 22 or 5432.Software ships with defaults that favour easy setup, environments drift over time, and infrastructure is created by many people through consoles, scripts and Terraform. A single toggle in a cloud console can expose millions of records, and automated scanners on the internet find open databases within hours.
A misconfiguration is about settings. An outdated library with a known CVE is "vulnerable and outdated components", and missing access checks in your code is "broken access control". In interviews it helps to show you can tell them apart, while noting they often combine: verbose errors (misconfiguration) leak a version that has a known exploit (outdated component).
import crypto from "node:crypto";
// Register after all routes
app.use((err, req, res, next) => {
const errorId = crypto.randomUUID();
// Full details stay in server logs
logger.error({ errorId, err, path: req.path });
// Client sees nothing internal
res.status(err.status ?? 500).json({
error: "Something went wrong",
errorId,
});
});
app.disable("x-powered-by"); // do not advertise the framework
Stack traces and internal messages go to logs, keyed by an ID the user can quote to support. The client never sees file paths or library versions.
# Enforce at the bucket level (can also be set account-wide)
aws s3api put-public-access-block \
--bucket kyc-documents-prod \
--public-access-block-configuration \
BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
# Verify
aws s3api get-public-access-block --bucket kyc-documents-prod
Since April 2023 new buckets have Block Public Access on by default, but older buckets and account settings still need checking.
Security Misconfiguration, OWASP Top 10, Hardening, Default Credentials, Verbose Errors, Public S3 Buckets