---
title: "CWE-390: Detection of Error Condition Without Action"
url: https://radicalnotion.ai/cwe/cwe-390
type: cwe
description: "The product detects a specific error, but takes no actions to handle the error."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-390: Detection of Error Condition Without Action

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **Likelihood of exploit:** Medium
- **CVEs with this as primary weakness:** 77
- **Of those, in CISA KEV:** 0
- **New in 2026:** 51
- **CWE catalog version:** 4.21

## Description

The product detects a specific error, but takes no actions to handle the error.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity, Other | Varies by Context, Unexpected State, Alter Execution Logic | An attacker could utilize an ignored error condition to place the system in an unexpected state that could lead to the execution of unintended logic and could cause other unintended behavior. |

## Potential mitigations

### 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.

## Detection methods

### Automated Static Analysis

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.)

Effectiveness: High

## Demonstrative examples

### Example 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.

Bad code:

```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.
}
```

Good code:

```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;
}
```

### Example 2

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.

Bad code:

```c++
char* readfile (char *filename) {
    try {
        // open input file
        ifstream infile;
        infile.open(filename);

        if (!infile.is_open()) {
            throw "Unable to open file " + filename;
        }

        // get length of file
        infile.seekg (0, ios::end);
        int length = infile.tellg();
        infile.seekg (0, ios::beg);

        // allocate memory
        char *buffer = new char [length];

        // read data from file
        infile.read (buffer,length);

        if (!infile.good()) {
            throw "Unable to read from file " + filename;
        }

        infile.close();

        return buffer;
    }
    catch (...) {
        /* bug: insert code to handle this later */
    }
}
```

Good code:

```c++
char* readFile (char *filename) {
    try {
        // open input file
        ifstream infile;
        infile.open(filename);

        if (!infile.is_open()) {
            throw "Unable to open file " + filename;
        }

        // get length of file
        infile.seekg (0, ios::end);
        int length = infile.tellg();
        infile.seekg (0, ios::beg);

        // allocate memory
        char *buffer = new char [length];

        // read data from file
        infile.read (buffer,length);

        if (!infile.good()) {
            throw "Unable to read from file " + filename;
        }
        infile.close();

        return buffer;
    }
    catch (char *str) {
        printf("Error: %s \n", str);
        infile.close();
        throw str;
    }
    catch (...) {
        printf("Error occurred trying to read from file \n");
        infile.close();
        throw;
    }
}
```

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.

### Example 3

In the following Java 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 a String object. The constructor of the FileReader object and the read method call may throw exceptions and therefore must be within a try/catch block. While the catch statement in this example will catch thrown exceptions in order for the method to compile, no processing is performed to handle the thrown exceptions. Catch statements that do not perform any processing will have unexpected results. In this case, this will result in the return of a null String.

Bad code:

```java
public String readFile(String filename) {
    String retString = null;
    try {
        // initialize File and FileReader objects
        File file = new File(filename);
        FileReader fr = new FileReader(file);

        // initialize character buffer
        long fLen = file.length();
        char[] cBuf = new char[(int) fLen];

        // read data from file
        int iRead = fr.read(cBuf, 0, (int) fLen);

        // close file
        fr.close();

        retString = new String(cBuf);
    } catch (Exception ex) {
        /* do nothing, but catch so it'll compile... */
    }
    return retString;
}
```

Good code:

```java
public String readFile(String filename) throws FileNotFoundException, IOException, Exception {
    String retString = null;
    try {
        // initialize File and FileReader objects
        File file = new File(filename);
        FileReader fr = new FileReader(file);

        // initialize character buffer
        long fLen = file.length();
        char [] cBuf = new char[(int) fLen];

        // read data from file
        int iRead = fr.read(cBuf, 0, (int) fLen);

        // close file
        fr.close();

        retString = new String(cBuf);
    } catch (FileNotFoundException ex) {
        System.err.println ("Error: FileNotFoundException opening the input file: " + filename );
        System.err.println ("" + ex.getMessage() );
        throw new FileNotFoundException(ex.getMessage());
    } catch (IOException ex) {
        System.err.println("Error: IOException reading the input file.\n" + ex.getMessage() );
        throw new IOException(ex);
    } catch (Exception ex) {
        System.err.println("Error: Exception reading the input file.\n" + ex.getMessage() );
        throw new Exception(ex);
    }
    return retString;
}
```

The catch statement should contain statements that either attempt to fix the problem, notify the user that an exception has been raised and continue processing, or perform some cleanup and gracefully terminate the program. The following Java example contains three catch statements. The first of these will catch the FileNotFoundException that may be thrown by the FileReader constructor called within the try/catch block. The second catch statement will catch the IOException that may be thrown by the read method called within the try/catch block. The third catch statement will catch all other exceptions thrown within the try block. For all catch statements the user is notified that the exception has been thrown and the exception is rethrown to the block that called the readFile() method for further processing or possible termination of the program. Note that with Java it is usually good practice to use the getMessage() method of the exception class to provide more information to the user about the exception raised.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2022-21820 | A GPU data center manager detects an error due to a malformed request but does not act on it, leading to memory corruption. |

## Real CVEs with this weakness (sample of 12 of 77)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-72421 | ipv4: fib: Don't ignore error route in local/main tables. | critical | 10.0 | - | No | 2026-08-15 |
| CVE-2026-111823 | - | critical | 9.8 | - | No | 2026-10-16 |
| CVE-2026-98269 | btrfs: abort transaction on failure to update inode for hole punching and reflinking | critical | 9.8 | - | No | 2026-10-06 |
| CVE-2026-72477 | fs/ntfs3: call \_ntfs\_bad\_inode() when failing to rename | critical | 9.8 | - | No | 2026-08-15 |
| CVE-2026-52989 | nvmet-tcp: propagate nvmet\_tcp\_build\_pdu\_iovec() errors to its callers | critical | 9.8 | - | No | 2026-06-24 |
| CVE-2026-43493 | crypto: pcrypt - Fix handling of MAY\_BACKLOG requests | critical | 9.8 | - | No | 2026-05-19 |
| CVE-2021-40391 | Gerbv: out-of-bounds write in the drill format T-code tool number functionality | critical | 9.8 | - | No | 2021-11-19 |
| CVE-2026-104480 | Improper MLS Welcome roster validation in Discord libdave allows unauthorized group membership | critical | 9.4 | - | No | 2026-10-02 |
| CVE-2026-53434 | Apache Tomcat: Invalid CRL configuration doesn't trigger failure for FFM Connector | critical | 9.1 | - | No | 2026-06-29 |
| CVE-2019-5051 | SDL2\_image: missing error handler when loading a PCX file can lead to a heap-based buffer overflow and potential code execution | high | 8.8 | - | No | 2019-07-03 |
| CVE-2026-76642 | util-linux libmount Privilege Escalation via Failed Mount Helper | high | 8.5 | - | No | 2026-09-03 |
| CVE-2026-43045 | mshv: Fix error handling in mshv\_region\_pin | high | 8.4 | - | No | 2026-05-01 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-755](https://radicalnotion.ai/cwe/cwe-755) | Improper Handling of Exceptional Conditions |
| Peer | [CWE-600](https://radicalnotion.ai/cwe/cwe-600) | Uncaught Exception in Servlet |
| Can precede | [CWE-401](https://radicalnotion.ai/cwe/cwe-401) | Missing Release of Memory after Effective Lifetime |
| Related | [CWE-81](https://radicalnotion.ai/cwe/cwe-81) | Improper Neutralization of Script in an Error Message Web Page |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CLASP | Improper error handling | - | - |
| The CERT Oracle Secure Coding Standard for Java (2011) | Do not suppress or ignore checked exceptions | ERR00-J | - |
| Software Fault Patterns | Unchecked Status Condition | SFP4 | - |

## Frequently asked questions

### What is CWE-390?

The product detects a specific error, but takes no actions to handle the error.

### What CVEs are caused by CWE-390?

77 recorded CVEs are attributed to CWE-390, including CVE-2026-72421, CVE-2026-111823 and CVE-2026-98269.

### How do you prevent CWE-390?

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.

### How is CWE-390 detected?

Automated Static Analysis: 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.)

### What are the consequences of CWE-390?

Exploiting CWE-390 can lead to: Varies by Context, Unexpected State, Alter Execution Logic.

### Is CWE-390 actively exploited?

77 recorded CVEs are caused by CWE-390; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/390.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-390). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
