CWEweakness
CWE-1322 Use of Blocking Code in Single-threaded, Non-blocking Context
- Abstraction
- Base
- Structure
- Simple
- Status
- Incomplete
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product uses a non-blocking model that relies on a single threaded process
for features such as scalability, but it contains code that can block when it is invoked.
Common consequences
• Availability: DoS: Resource Consumption (CPU) — When an attacker can directly invoke the blocking code, or the blocking code can be affected by environmental conditions that can be influenced by an attacker, then this can lead to a denial of service by causing unexpected hang or freeze of the code. An unexpected call to blocking code can trigger an infinite loop, or a large loop that causes the software to pause and wait indefinitely.
Potential mitigations
• [Implementation] Generally speaking, blocking calls should be
replaced with non-blocking alternatives that can be used asynchronously.
Expensive computations should be passed off to worker threads, although
the correct approach depends on the framework being used.
• [Implementation] For expensive computations, consider breaking them up into
multiple smaller computations. Refer to the documentation of the
framework being used for guidance.
Related
Attack pattern · CAPEC (1)
- CAPEC-25 Forced Deadlock attack pattern
Can precede · CWE (1)
- CWE-835 Loop with Unreachable Exit Condition weakness
Child of · CWE (1)
- CWE-834 Excessive Iteration weakness
Referenced by CAPEC · weakness (1)
- CAPEC-25 Forced Deadlock attack pattern
Referenced by CVE · weakness (4)
- CVE-2026-89329 A flaw was found in `multipathd`. vulnerability
- CVE-2026-19484 @fastify/busboy is a multipart form-data parser. vulnerability
- CVE-2026-71439 Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. vulnerability
- CVE-2026-42256 Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. vulnerability