CWE-774: Allocation of File Descriptors or Handles Without Limits or Throttling

What is CWE-774?

CWE-774 is Allocation of File Descriptors or Handles Without Limits or Throttling. The flaw arises when the product allocates file descriptors or handles on behalf of an actor without imposing any restrictions on how many descriptors can be allocated, in violation of the intended security policy for that actor.

OWASP Top 10 Rank-
Related CVES (365 days)-
AbstractionVariant
Likelihood of exploitLow

No data

No vulnerability data for CWE-774

No data

No vulnerability data in CISA KEV for CWE-774

Official definition

ByMitre CWE

The product allocates file descriptors or handles on behalf of an actor without imposing any restrictions on how many descriptors can be allocated, in violation of the intended security policy for that actor.

This can cause the product to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.

Characteristics

Alternate terms

  • File Descriptor Exhaustion

Modes of introduction

  • Architecture and Design
  • Implementation

Common consequences

ImpactScopeExplanation
DoS: Resource Consumption (Other)AvailabilityWhen allocating resources without limits, an attacker could prevent all other processes from accessing the same type of resource.

Risk mitigations

  1. Resource Limitation · Operation, Architecture and DesignUse 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

MethodApproachEffectiveness
Automated Static AnalysisAutomated 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.)-
Sources (2)

CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.

Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.