Coverage area · Partly checked automatically

Exposed information: what your code gives away

Attackers start by collecting what you expose. A lot of that comes from the code itself: debug routes, verbose errors, files served by accident, and old secrets left in past commits. OpenRouting checks part of this automatically; the rest is a checklist.

what to look for · Exposed information
[ ] Debug routes reachable in prod?
[ ] Stack traces sent to clients?
[ ] Repo files or source maps served?
fix: serve public/ only, generic errors
$ 

A manual checklist for this area. The example below isn't flagged by a stock rule; see what is checked today.

What OpenRouting checks today

Partly checked automatically

Semgrep's default ruleset flags debug mode in Flask and .NET, Django's {% debug %} template tag, exposed Go pprof endpoints, directory listing in Express and secrets in the current files; a passive website scan of a URL you add reports version-revealing headers and error pages that leak detail. Not checked: git history (only the current files are scanned), served .git folders and source maps, and any external reconnaissance.

Why this area matters

Information exposure (CWE-200, CWE-209, CWE-215) is rarely the breach itself, but it is how breaches get planned: a stack trace names the framework version, a debug route lists environment variables, a served .git directory hands over the source, and a secret committed years ago is still in the repository's past commits.

Rules flag these individually. Whether they matter depends on whether the route is reachable in production, whether the error handler is dev-only, and whether a leaked value is still valid. The review step checks each of those for the findings Semgrep and the website scan raise.

What goes wrong in real applications

  • Debug and diagnostic endpoints

    Routes that dump configuration, environment variables or internal state, left reachable in production, give outsiders a map of your system and sometimes its credentials.

  • Verbose errors

    Stack traces and raw exception messages returned to clients reveal paths, versions, queries and internal hostnames.

  • Files served by accident

    Serving the project root exposes .git, .env, backups and source maps, which can reconstruct the full source and its secrets.

  • Secrets in past commits

    A credential removed in a later commit is still in the repository and in every clone. If the repository is ever public, it is effectively published.

Sample: the risky pattern and the fix

Riskyserver/app.js
const app = express();
app.use(express.static("."));            // serves .git, .env, source

app.get("/debug/env", (req, res) => res.json(process.env));

app.use((err, req, res, next) => {
  res.status(500).json({ error: err.message, stack: err.stack });
});
Saferserver/app.js
const app = express();
app.use(express.static("public", { dotfiles: "deny" }));

if (process.env.NODE_ENV !== "production") {
  app.get("/debug/health", (req, res) => res.json({ ok: true }));
}

app.use((err, req, res, next) => {
  const id = crypto.randomUUID();
  logger.error({ err, id }, "unhandled error");
  res.status(500).json({ error: "Internal error", id });
});

The original serves the whole project directory, exposes every environment variable on a public route and returns stack traces to clients. The fix serves only the public folder with dotfiles denied, keeps diagnostics out of production and returns a generic error with a correlation ID while logging the detail server-side.

Illustrative code, simplified for clarity — not taken from a customer repository.

What to look for in your code

  • Debug, admin and diagnostic routes, and whether they are gated to non-production
  • Error handlers that return stack traces or exception messages
  • Static-file serving roots and production source-map settings
  • Secrets in past commits (git history is not scanned today; use a history scanner and rotate anything it finds)
  • Committed .env files, backups and config with internal hostnames

Scope and limits

  • It doesn't do external reconnaissance: no OSINT, subdomain enumeration, port scanning or searching other sites. It reviews what your repository would expose.
  • Secret rules run on the current files only: git history is not scanned, and neither are forks, mirrors or paste sites where a secret may have been copied.

The checklist above is broader than what runs automatically; see what OpenRouting checks today. Where a scanner does run, it surfaces candidates and a review agent decides whether each one is real — it doesn't promise to find every issue.

Review agents for this area

These agents give the verdict and fix when a scanner raises a finding here.

  • Secrets & data exposure — Judges whether a flagged value is really a secret and whether sensitive data leaks through logs or errors.
  • Infrastructure & IaC — Reviews Terraform, Helm, Ansible and server config for insecure defaults and exposure.

Common questions

Does OpenRouting scan my public attack surface?

No. Code scans never probe your domains or hosts. The optional passive website scan loads pages of a URL you add, without attack payloads, and reports what those responses reveal.

I deleted a leaked key in a later commit. Am I safe?

No. The key is still in the repository's past commits and every clone. OpenRouting scans the current files only, so it won't report a deleted key; rotate it, then optionally rewrite history.