← Back to all labs
OWASP A02 · LAB ENVIRONMENT

Security Misconfiguration

Security Misconfiguration happens when systems ship with insecure defaults, unnecessary features left on, verbose error output, or permissive cloud settings. Try the interactive playground below to see exactly what a misconfigured production server leaks.

OWASP TOP 10 · 2025 · A02 — SECURITY MISCONFIGURATION

Debug Mode Playground: What Your Server Says When It Fails

Security Misconfiguration happens when systems are deployed with insecure default settings, unnecessary features left enabled, overly verbose error handling, or permissive cloud/storage permissions. It’s rarely a single dramatic flaw — it’s usually a setting someone forgot to change before going to production, like leaving a debug console, a sample admin app, or a “DEBUG=True” flag switched on for the whole world to see.

Debug Mode: OFF (Secure / Production Config) The server is configured the way it should be for a live production site.
⚠ UNHANDLED EXCEPTION — DEBUG MODE ENABLED
SERVER RESPONSE
500
Internal Server Error. Something went wrong on our end — our team has been notified.
ref: a1c9f2-…
Vulnerable Config
# settings.py
DEBUG = True
ALLOWED_HOSTS = ["*"]

# .env (loaded into error page on crash)
DATABASE_URL=postgres://admin:Winter2024!@db-prod-01.internal:5432/app
API_KEY=sk_live_9fA2...kQ7
INTERNAL_HOST=prod-app-03.internal.corp

# Any 500 error now renders a full
# traceback + these variables to any visitor.
Secure Config
# settings.py
DEBUG = False
ALLOWED_HOSTS = ["cybersecuritytelugu.com"]

# Custom error handler
def handler500(request):
    log_error_internally(request)     # full trace → logs only
    return render(request,
        "errors/500_generic.html",
        status=500)

# Visitor sees a generic message.
# Engineers see the real trace in log tooling.

Real-world pattern: a huge share of breach disclosures trace back to something this mundane — a debug console left reachable on a production URL, a cloud storage bucket left with public/world permissions “just for testing” or an old sample admin panel that was never removed after go-live. None of these require a clever exploit; they just require someone to look.

  • Disable debug/verbose error output in every production environment, and confirm it via automated checks in CI/CD before deploy.
  • Run security header and configuration scanners regularly against live endpoints to catch drift from your intended baseline.
  • Automate config hardening against a recognized baseline (e.g. CIS Benchmarks) instead of relying on manual, one-time setup.
  • Audit cloud storage and bucket permissions on a schedule — default-deny, then explicitly grant only what’s needed.
  • Remove default accounts, sample applications, and unused features/services before anything reaches production.