CWE-211 Base Incomplete

Externally-Generated Error Message Containing Sensitive Information

This vulnerability occurs when an application triggers an error message from an external component—like a database, interpreter, or operating system—and that error reveals sensitive details about…

Definition

What is CWE-211?

This vulnerability occurs when an application triggers an error message from an external component—like a database, interpreter, or operating system—and that error reveals sensitive details about the system's internal workings, configuration, or data.
Unlike application-controlled errors, these messages originate from underlying platforms or dependencies and often include technical details developers didn't intend to expose. Attackers can deliberately trigger these errors by sending malformed inputs or causing system failures, then harvest information like stack traces, file paths, database schemas, or server versions to plan further attacks. Preventing this requires a defense-in-depth approach: configure external components to suppress verbose errors in production, implement centralized exception handling to catch and sanitize all external messages before they reach users, and ensure logging systems capture detailed diagnostics separately without exposing them through user interfaces. Regular testing with fuzzing and penetration testing helps identify what information leaks through these indirect channels.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-211

  • chain: product does not protect against direct request of an include file, leading to resultant path disclosure when the include file does not successfully execute.

  • Single "'" inserted into SQL query leads to invalid SQL query execution, triggering full path disclosure. Possibly resultant from more general SQL injection issue.

  • chain: product does not protect against direct request of a library file, leading to resultant path disclosure when the file does not successfully execute.

  • invalid parameter triggers a failure to find an include file, leading to infoleak in error message.

  • Various invalid requests lead to information leak in verbose error messages describing the failure to instantiate a class, open a configuration file, or execute an undefined function.

  • Improper handling of filename request with trailing "/" causes multiple consequences, including information leak in Visual Basic error message.

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    The following servlet code does not catch runtime exceptions, meaning that if such an exception were to occur, the container may display potentially dangerous information (such as a full stack trace).

  2. 2

    In the following Java example the class InputFileRead enables an input file to be read using a FileReader object. In the constructor of this class a default input file path is set to some directory on the local file system and the method setInputFile must be called to set the name of the input file to be read in the default directory. The method readInputFile will create the FileReader object and will read the contents of the file. If the method setInputFile is not called prior to calling the method readInputFile then the File object will remain null when initializing the FileReader object. A Java RuntimeException will be raised, and an error message will be output to the user.

  3. 3

    However, the error message output to the user contains information regarding the default directory on the local file system. This information can be exploited and may lead to unauthorized access or use of the system. Any Java RuntimeExceptions that are handled should not expose sensitive information to the user.

Verwundbares Codebeispiel

Vulnerable Java

The following servlet code does not catch runtime exceptions, meaning that if such an exception were to occur, the container may display potentially dangerous information (such as a full stack trace).

Verwundbar Java
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  		String username = request.getParameter("username");
```
// May cause unchecked NullPointerException.* 
  		if (username.length() < 10) {
  		```
  			...
  		}
  }
Sicheres Codebeispiel

Secure pseudo

Sicher pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
  const safe = validateAndEscape(input);
  return executeWithGuards(safe);
}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Präventions-Checkliste

How to prevent CWE-211

  • System Configuration Configure the application's environment in a way that prevents errors from being generated. For example, in PHP, disable display_errors.
  • Implementation / Build and Compilation Debugging information should not make its way into a production release.
  • Implementation / Build and Compilation Debugging information should not make its way into a production release.
  • Implementation Handle exceptions internally and do not display errors containing potentially sensitive information to a user. Create default error pages if necessary.
  • Implementation The best way to prevent this weakness during implementation is to avoid any bugs that could trigger the external error message. This typically happens when the program encounters fatal errors, such as a divide-by-zero. You will not always be able to control the use of error pages, and you might not be using a language that handles exceptions.
Erkennungssignale

How to detect CWE-211

SAST High

Führe statische Analyse (SAST) auf der Codebasis aus und suche im Datenfluss nach dem unsicheren Muster.

DAST Moderate

Führe dynamische Application-Security-Tests gegen den Live-Endpoint aus.

Runtime Moderate

Beobachte Runtime-Logs auf ungewöhnliche Exception-Traces, fehlerhafte Eingaben oder Versuche, Autorisierung zu umgehen.

Code review Moderate

Code Review: Markiere jeden neuen Code, der Eingaben von dieser Oberfläche ohne validierte Framework-Helper verarbeitet.

Plexicus Auto-Fix

Plexicus erkennt CWE-211 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.

Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.

Häufig gestellte Fragen

Frequently asked questions

Was ist CWE-211?

This vulnerability occurs when an application triggers an error message from an external component—like a database, interpreter, or operating system—and that error reveals sensitive details about the system's internal workings, configuration, or data.

Wie gravierend ist CWE-211?

MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.

Welche Sprachen oder Plattformen sind von CWE-211 betroffen?

MITRE lists the following affected platforms: PHP.

Wie kann ich CWE-211 verhindern?

Configure the application's environment in a way that prevents errors from being generated. For example, in PHP, disable display_errors. Debugging information should not make its way into a production release.

Wie erkennt und behebt Plexicus CWE-211?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-211 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.

Wo erfahre ich mehr über CWE-211?

MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/211.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.

Bereit, wenn du es bist

Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.

Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.