CWE-390 Base Draft Medium likelihood

Detection of Error Condition Without Action

This weakness occurs when software successfully identifies an error condition but then fails to take any meaningful action to address it. The error is detected but ignored, leaving the system in an…

Definition

What is CWE-390?

This weakness occurs when software successfully identifies an error condition but then fails to take any meaningful action to address it. The error is detected but ignored, leaving the system in an inconsistent or vulnerable state.
Imagine your code checks for a failed login attempt, a missing file, or a network timeout, but then simply logs the event and continues normal execution as if nothing went wrong. This creates a silent failure where the root problem isn't corrected, and the application might proceed using bad data, null pointers, or unstable connections. The core issue is that detection logic is present, but the crucial response—like rolling back a transaction, showing a user-friendly alert, or falling back to a secure default—is completely missing. For developers, this often stems from placeholder error handling, such as empty `catch` blocks or generic logging statements that don't trigger remediation. To fix it, every error check must have a defined outcome: terminate the operation safely, retry with limitations, notify the user appropriately, or revert to a known good state. Treating error detection as a separate step from the response action leaves critical security and stability gaps that attackers or unexpected conditions can easily exploit.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-390

  • A GPU data center manager detects an error due to a malformed request but does not act on it, leading to memory corruption.

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    The following example attempts to allocate memory for a character. After the call to malloc, an if statement is used to check whether the malloc function failed.

  2. 2

    The conditional successfully detects a NULL return value from malloc indicating a failure, however it does not do anything to handle the problem. Unhandled errors may have unexpected results and may cause the program to crash or terminate.

  3. 3

    Instead, the if block should contain statements that either attempt to fix the problem or notify the user that an error has occurred and continue processing or perform some cleanup and gracefully terminate the program. The following example notifies the user that the malloc function did not allocate the required memory resources and returns an error code.

  4. 4

    In the following C++ example the method readFile() will read the file whose name is provided in the input parameter and will return the contents of the file in char string. The method calls open() and read() may result in errors if the file does not exist or does not contain any data to read. These errors will be thrown when the is_open() method and good() method indicate errors opening or reading the file. However, these errors are not handled within the catch statement. Catch statements that do not perform any processing will have unexpected results. In this case an empty char string will be returned, and the file will not be properly closed.

  5. 5

    The catch statement should contain statements that either attempt to fix the problem or notify the user that an error has occurred and continue processing or perform some cleanup and gracefully terminate the program. The following C++ example contains two catch statements. The first of these will catch a specific error thrown within the try block, and the second catch statement will catch all other errors from within the catch block. Both catch statements will notify the user that an error has occurred, close the file, and rethrow to the block that called the readFile() method for further handling or possible termination of the program.

Verwundbares Codebeispiel

Vulnerable C

The following example attempts to allocate memory for a character. After the call to malloc, an if statement is used to check whether the malloc function failed.

Verwundbar C
foo=malloc(sizeof(char)); //the next line checks to see if malloc failed
  if (foo==NULL) {
  	//We do nothing so we just ignore the error.
  }
Sicheres Codebeispiel

Secure C

Instead, the if block should contain statements that either attempt to fix the problem or notify the user that an error has occurred and continue processing or perform some cleanup and gracefully terminate the program. The following example notifies the user that the malloc function did not allocate the required memory resources and returns an error code.

Sicher C
foo=malloc(sizeof(char)); //the next line checks to see if malloc failed
  if (foo==NULL) {
  	printf("Malloc failed to allocate memory resources");
  	return -1;
  }
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-390

  • Implementation Properly handle each exception. This is the recommended solution. Ensure that all exceptions are handled in such a way that you can be sure of the state of your system at any given moment.
  • Implementation If a function returns an error, it is important to either fix the problem and try again, alert the user that an error has happened and let the program continue, or alert the user and close and cleanup the program.
  • Testing Subject the product to extensive testing to discover some of the possible instances of where/how errors or return values are not handled. Consider testing techniques such as ad hoc, equivalence partitioning, robustness and fault tolerance, mutation, and fuzzing.
Erkennungssignale

How to detect CWE-390

Automated Static Analysis High

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Plexicus Auto-Fix

Plexicus erkennt CWE-390 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-390?

This weakness occurs when software successfully identifies an error condition but then fails to take any meaningful action to address it. The error is detected but ignored, leaving the system in an inconsistent or vulnerable state.

Wie gravierend ist CWE-390?

MITRE stuft die Exploit-Wahrscheinlichkeit als mittel ein — eine Ausnutzung ist realistisch, erfordert aber meist bestimmte Bedingungen.

Welche Sprachen oder Plattformen sind von CWE-390 betroffen?

MITRE hat für diese CWE keine betroffenen Plattformen spezifiziert — sie kann in den meisten Anwendungs-Stacks auftreten.

Wie kann ich CWE-390 verhindern?

Properly handle each exception. This is the recommended solution. Ensure that all exceptions are handled in such a way that you can be sure of the state of your system at any given moment. If a function returns an error, it is important to either fix the problem and try again, alert the user that an error has happened and let the program continue, or alert the user and close and cleanup the program.

Wie erkennt und behebt Plexicus CWE-390?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-390 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-390?

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

Verwandte Schwachstellen

Weaknesses related to CWE-390

CWE-755 Parent

Improper Handling of Exceptional Conditions

This vulnerability occurs when software fails to properly manage unexpected situations or errors, leaving it in an unstable or insecure…

CWE-209 Sibling

Generation of Error Message Containing Sensitive Information

This vulnerability occurs when an application reveals sensitive details about its internal systems, user data, or environment within error…

CWE-248 Sibling

Uncaught Exception

This vulnerability occurs when a function throws an error or exception, but the calling code does not have a proper handler to catch and…

CWE-274 Sibling

Improper Handling of Insufficient Privileges

This vulnerability occurs when an application fails to properly manage situations where it lacks the necessary permissions to execute an…

CWE-280 Sibling

Improper Handling of Insufficient Permissions or Privileges

This vulnerability occurs when a system fails to properly manage situations where it lacks the necessary permissions to perform an action…

CWE-333 Sibling

Improper Handling of Insufficient Entropy in TRNG

This vulnerability occurs when a system fails to properly manage the limited or unpredictable output rate of a true random number…

CWE-392 Sibling

Missing Report of Error Condition

This vulnerability occurs when a system fails to properly signal that an error has happened. Instead of returning a clear error code,…

CWE-395 Sibling

Use of NullPointerException Catch to Detect NULL Pointer Dereference

Using a try-catch block for NullPointerException as a substitute for proper null checks is an anti-pattern. This approach masks the root…

CWE-396 Sibling

Declaration of Catch for Generic Exception

This weakness occurs when code catches a generic exception type like 'Exception' or 'Throwable', which can hide specific errors and create…

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.