CWE-209Data exposureSeverity · Low

Errors that explain the system

Error responses that show stack traces, SQL queries or internal hostnames. Each one hands an attacker a map of the technology and where it might break.

At a glance

Controls
CWE-209 · A04:2021 Insecure Design
Typical severityLow
ReferenceCWE-209
OWASP Top 10A04:2021 Insecure Design

What it is

When a request fails, some products return the raw technical error to the user. That can include a stack trace, the database query, file paths, library versions or the names of internal servers. Debug settings left on in production are a common cause.

Attackers trigger errors on purpose with odd inputs and read what comes back. The details tell them which framework and versions to target and where input reaches the database. AI-assisted attackers can send many malformed requests at once and summarise the leaked details into a target list.

Where it hides

What a reviewer can look for in the code and in the behaviour, before anyone proves it.

  • API endpoints that fail on unexpected types or very long inputs
  • Search, filter and sort parameters passed into database queries
  • File upload and import flows that parse documents
  • Framework debug modes and default error pages left on in production

How MATT tests it

The proof runs against the deployed product, on every release, whoever wrote the code.

  1. 01Sign in as a test user and send malformed values to each input on the main endpoints.
  2. 02Record every response that includes a trace, a query, a path or an internal host.
  3. 03Match each leak to the code path and configuration that produced it.
The rule, in plain English

Errors shown to users must say what went wrong and nothing about how the system is built.

Executable check

as user A: POST /v1/orders with body {"quantity": "abc"} expect: 4xx with a short message and a reference id expect: no stack trace, SQL, file path or internal hostname in the body expect: no framework or version header in the response

Every rule MATT holds →

What the fix looks like

  1. 01

    Turn off debug mode and detailed error pages in production.

  2. 02

    Add one error handler that returns a plain message and a reference id.

  3. 03

    Write the full technical detail to server logs, linked by that reference id.

  4. 04

    Remove version and framework headers from responses.

A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →

ExploitOps discovery call

Understand where your security loop breaks.

A call with a MATT co-founder to understand your product and whether an ExploitOps Review is worth doing. If there is a real need, we scope one with the research team.

Let’s understand your priority

What brings you to MATT?

What would you like help with?
01 / 02