Transmission of Private Resources into a New Sphere ('Resource Leak')

Draft Class
Structure: Simple
Description

This vulnerability occurs when an application unintentionally exposes internal resources, like files, memory, or database connections, to unauthorized users or systems. Essentially, it's a type of resource leak where sensitive assets cross a security boundary.

Extended Description

At its core, this weakness is about a failure in access control for non-data resources. While similar to information exposure (CWE-200), the focus here is on the unauthorized transfer of the resource *itself*—such as a file handle, a socket, or a memory block—into a context where an untrusted actor can use, modify, or exhaust it. This often happens due to logic errors, incorrect cleanup routines, or flawed object lifecycle management, allowing attackers to drain system availability or gain unintended access. For developers, the primary risk is a degradation of system stability and security through resource exhaustion (like Denial of Service) or privilege escalation. To prevent it, rigorously enforce the principle of least privilege for all resource handles, implement robust and audited cleanup paths (finally blocks, using statements, or RAII patterns), and validate that all resource transfers are explicitly authorized. Treat internal handles with the same caution as sensitive data.

Common Consequences 1
Scope: Confidentiality

Impact: Read Application Data

Detection Methods 1
Automated Static AnalysisHigh
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.)
Observed Examples 2
CVE-2003-0740Server leaks a privileged file descriptor, allowing the server to be hijacked.
CVE-2004-1033File descriptor leak allows read of restricted files.
Modes of Introduction
Architecture and Design
Implementation
Alternate Terms

Resource Leak

Taxonomy Mapping
  • PLOVER