CWEweakness
CWE-775 Missing Release of File Descriptor or Handle after Effective Lifetime
- Abstraction
- Variant
- Structure
- Simple
- Status
- Incomplete
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product does not release a file descriptor or handle after its effective lifetime has ended, i.e., after the file descriptor/handle is no longer needed.
Common consequences
• Availability: DoS: Resource Consumption (Other) — An attacker that can influence the allocation of resources that are not properly released could deplete the available resource pool and prevent all other processes from accessing the same type of resource. When a file descriptor or handle is not released after use (typically by explicitly closing it), attackers can attempt to open a large number of file descriptors/handles, thus consuming all available file descriptors/handles, or otherwise preventing other system processes from obtaining their own file descriptors/handles.
Potential mitigations
• [Operation, Architecture and Design] Use resource-limiting settings provided by the operating system or environment. For example, when managing system resources in POSIX, setrlimit() can be used to set limits for certain types of resources, and getrlimit() can determine how many resources are available. However, these functions are not available on all operating systems.
When the current levels get close to the maximum that is defined for the application (see CWE-770), then limit the allocation of further resources to privileged users; alternately, begin releasing resources for less-privileged users. While this mitigation may protect the system from attack, it will not necessarily stop attackers from adversely impacting other users.
Ensure that the application performs the appropriate error checks and error handling in case resources become unavailable (CWE-703).
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.)
Observed examples
• CVE-2007-0897: Chain: anti-virus product encounters a malformed file but returns from a function without closing a file descriptor (CWE-775) leading to file descriptor consumption (CWE-400) and failed scans.
Related
Observed example · CVE (1)
- CVE-2007-0897 Clam AntiVirus ClamAV before 0.90 does not close open file descriptors under certain conditions, which allows remote attackers to cause a… vulnerability
Child of · CWE (2)
Referenced by CVE · weakness (10)
- CVE-2026-110831 FreeRDP versions 3.13.0 before 3.32.0 contain a resource retention flaw in drive_process_irp_create, which registers an opened local file… vulnerability
- CVE-2026-106575 ImageMagick is free and open-source software used for editing and manipulating digital images. vulnerability
- CVE-2026-78408 The nsenter --join-cgroup option opens the target cgroup.procs file as root and leaves that file descriptor open across later namespace and… vulnerability
- CVE-2026-45287 OpenTelemetry-Go is the Go implementation of OpenTelemetry. vulnerability
- CVE-2019-25557 TwistedBrush Pro Studio 24.06 contains a denial of service vulnerability that allows local attackers to crash the application by importing… vulnerability
- CVE-2025-13751 Interactive service agent in OpenVPN version 2.5.0 through 2.6.16 and 2.7_alpha1 through 2.7_rc2 on Windows allows a local authenticated… vulnerability
- CVE-2025-53476 A denial of service vulnerability exists in the ModbusTCP server functionality of OpenPLC _v3 a931181e8b81e36fadf7b74d5cba99b73c3f6d58. vulnerability
- CVE-2024-24444 Improper file descriptor handling for closed connections in OpenAirInterface CN5G AMF (oai-cn5g-amf) up to v2.0.0 allows attackers to cause… vulnerability
- CVE-2017-8452 Kibana versions prior to 5.2.1 configured for SSL client access, file descriptors will fail to be cleaned up after certain requests and… vulnerability
- CVE-2016-8819 All versions of NVIDIA Windows GPU Display Driver contain a vulnerability in the kernel mode layer (nvlddmkm.sys) handler for DxgkDdiEscape… vulnerability