1100
with "sinks" (destinations where the data interacts with external components, a lower layer such
as the OS, etc.)
Effectiveness = High
Potential Mitigations
Phase: Architecture and Design
Phase: Implementation
Temporary files and other supporting resources should be deleted/released immediately after
they are no longer needed.
Demonstrative Examples
Example 1:
Stream resources in a Java application should be released in a finally block, otherwise an
exception thrown before the call to close() would result in an unreleased I/O resource. In the
example below, the close() method is called in the try block (incorrect).
Example Language: Java (Bad)
try {
InputStream is = new FileInputStream(path);
byte b[] = new byte[is.available()];
is.read(b);
is.close();
} catch (Throwable t) {
log.error("Something bad happened: " + t.getMessage());
}
Observed Examples
Reference Description
CVE-2000-0552 World-readable temporary file not deleted after use.
https://www.cve.org/CVERecord?id=CVE-2000-0552
CVE-2005-2293 Temporary file not deleted after use, leaking database usernames and
passwords.
https://www.cve.org/CVERecord?id=CVE-2005-2293
CVE-2002-0788 Interaction error creates a temporary file that can not be deleted due to strong
permissions.
https://www.cve.org/CVERecord?id=CVE-2002-0788
CVE-2002-2066 Alternate data streams for NTFS files are not cleared when files are wiped
(alternate channel / infoleak).
https://www.cve.org/CVERecord?id=CVE-2002-2066
CVE-2002-2067 Alternate data streams for NTFS files are not cleared when files are wiped
(alternate channel / infoleak).
https://www.cve.org/CVERecord?id=CVE-2002-2067
CVE-2002-2068 Alternate data streams for NTFS files are not cleared when files are wiped
(alternate channel / infoleak).
https://www.cve.org/CVERecord?id=CVE-2002-2068
CVE-2002-2069 Alternate data streams for NTFS files are not cleared when files are wiped
(alternate channel / infoleak).
https://www.cve.org/CVERecord?id=CVE-2002-2069
CVE-2002-2070 Alternate data streams for NTFS files are not cleared when files are wiped
(alternate channel / infoleak).
https://www.cve.org/CVERecord?id=CVE-2002-2070
CVE-2005-1744 Users not logged out when application is restarted after security-relevant
changes were made.
https://www.cve.org/CVERecord?id=CVE-2005-1744
CWE Version 4.14
CWE-459: Incomplete Cleanup
CWE-459: Incomplete Cleanup