CWE-401: Missing Release of Memory after Effective Lifetime
VariantLikelihood of exploit: Medium
The product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse.
Consequences
- Availability: DoS: Crash, Exit, or Restart, DoS: Instability, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory)
- Other: Reduce Performance
How to prevent it
- Implementation: Choose a language or tool that provides automatic memory management, or makes manual memory management less error-prone. For example, glibc in Linux provides protection against free of invalid pointers. When using Xcode to target OS X or iOS, enable automatic reference counting (ARC) [REF-391]. To help correctly and consistently manage memory when programming in C++, consider using a smart pointer class such as std::auto_ptr (defined by ISO/IEC ISO/IEC 14882:2003), std::shared_ptr and std::unique_ptr (specified by an upcoming revision of the C++ standard, informally referred to as C++ 1x), or equivalent solutions such as Boost.
- Architecture and Design: Use an abstraction library to abstract away risky APIs. Not a complete solution.
- Architecture and Design, Build and Compilation: Consider using the Boehm-Demers-Weiser garbage collector (bdwgc), which can help avoid leaks.
Recent advisories
- PYSEC-2026-3996 — vLLM through 0.29.0 fails to properly clean up decode-side metadata for rejected inference requests in prefill/decode disaggregated deployments.
- GHSA-vc2v-76pw-4v95 — compression vulnerable to Denial of Service via memory leak on premature response close
- GHSA-xpxj-f2fm-rqch — OliveTin: Unauthenticated DoS via OAuth2 State Memory Exhaustion (Unbounded Map Growth)
- GHSA-52jp-gj8w-j6xh — MCP Ruby SDK: Unbounded session retention in StreamableHTTPTransport allows memory exhaustion via initialize flood
- GHSA-cvhv-g4rq-3hmw — ImageMagick: Memory Leak when providing invalid options to the cli
- GHSA-h5r4-w88w-7ccr — ImageMagick: Memory Leak in TIFF encoder when invalid tiff:tile-geometry is specified
- GHSA-h58x-r7f7-rh84 — ImageMagick: Memory Leak in ICON decoder when allocation fails
- GHSA-r628-69v2-2f9c — ImageMagick: Memory Leak in MIFF encoder when allocaton fails
- GHSA-h7f2-f9cc-h2gv — ImageMagick: Memory Leak in YUV decoder when opening of blob fails
- GHSA-jfq9-q63x-rc63 — ImageMagick: Memory Leak in TIFF encoder when an allocation fails
- GHSA-99w9-hv66-rfv7 — ImageMagick: Memory Leak in JNG encoder when a blob could not be opened
- GHSA-j8rh-v2r8-v94x — ImageMagick: Memory Leak in hough lines operation when an operation fails
- GHSA-7c7m-fpjw-gwcq — ImageMagick: Memory Leak in color transformation to log colorspace when operation fails
- GHSA-6vxp-gfwf-hcr9 — ImageMagick: Memory Leak in TIFF encoder when a temporary file could not be created.
- GHSA-9299-c6m4-mjhc — Eclipse Jetty: DoS attack triggering OutOfMemory with 100-Continue requests
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor