ankur@sec:~$

$ cat owasp/a02.md

A02:2025

Security Misconfiguration

The code is fine. The server, framework or cloud settings around it are not.

## 1 · why it happens

Defaults are built for getting started, not for production: debug mode on, sample pages installed, directory listing enabled, verbose errors, every HTTP method allowed.

This is the category OSINT finds best, because misconfiguration is visible from outside: an exposed .git folder, a staging server on a forgotten subdomain, a Swagger page, a version banner. XXE also lives here - it is an XML parser with dangerous features left on.

# JavaScript

✗ vulnerable
const app = express();
app.use(express.static('.'));          // serves .git, .env, everything
app.use((err, req, res, next) => {
  res.status(500).send(err.stack);     // stack trace to the world
});
✓ fixed
const app = express();
app.disable('x-powered-by');
app.use(helmet());                      // sane security headers
app.use(express.static('public', { dotfiles: 'deny' }));
app.use((err, req, res, next) => {
  logger.error(err);
  res.status(500).json({ error: 'Internal error' });
});

# C#

✗ vulnerable
var settings = new XmlReaderSettings
{
    DtdProcessing = DtdProcessing.Parse,   // enables XXE
    XmlResolver = new XmlUrlResolver()
};
// and in Program.cs:
app.UseDeveloperExceptionPage();           // in production
✓ fixed
var settings = new XmlReaderSettings
{
    DtdProcessing = DtdProcessing.Prohibit,
    XmlResolver = null
};
// Program.cs
if (app.Environment.IsDevelopment())
    app.UseDeveloperExceptionPage();
else
    app.UseExceptionHandler("/error");

## 2 · how attackers find it from outside

public sourcewhat it tells them
Certificate transparency (crt.name)staging., dev., old-admin. subdomains - usually configured with less care than production.
Shodan / CensysOpen admin ports, default pages and exact server versions, already indexed.
Search engine dorksIndexed directory listings, .env files and error pages.
HTTP response headersServer: nginx/1.18.0, X-Powered-By - the exact version to look up in a CVE database.

→ all OSINT sources · run them on yourself

## 3 · how it's abused

⚠ Recon your own assets, or targets you have written permission to test. Passive OSINT reads public data, but using it to target someone else's systems can still be illegal or against their terms. Examples on this site use example.com placeholders.

GET /.git/HEAD

If this returns "ref: refs/heads/main", the whole source code can be downloaded.

GET /.env

Framework config file with database passwords and API keys.

GET /swagger/index.html

A full, clickable map of your API - handy for attackers too.

<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><foo>&xxe;</foo>

XXE: asks the XML parser to read a local file and put it in the response.

Payload examples adapted from PayloadsAllTheThings (MIT, © Swissky). Full lists:Insecure Source Code Management · Insecure Management Interface · XXE Injection · Web Cache Deception · Reverse Proxy Misconfigurations

## 4 · fix

## 5 · detect

osint / reconpassive

subfinder

Fast passive subdomain discovery from many public sources.

map the surface

httpx

Which of your subdomains are alive, and what is running on them?

authorized targets only
test it

Artemis

Modular vulnerability scanner with automatic reports, by CERT Polska.

authorized targets only
fix at source

Checkov

Finds misconfigurations in Terraform, Kubernetes, Dockerfiles and CI configs.

fix at source

KICS

Infrastructure-as-code scanner with thousands of queries.

Official description: OWASP A02:2025 Security Misconfiguration