---
title: "CWE-1325: Improperly Controlled Sequential Memory Allocation"
url: https://radicalnotion.ai/cwe/cwe-1325
type: cwe
description: "The product manages a group of objects or resources and performs a separate memory allocation for each object, but it does not properly limit the total amount of memory that is consumed by all of the combined objects."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1325: Improperly Controlled Sequential Memory Allocation

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 26
- **Of those, in CISA KEV:** 0
- **New in 2026:** 16
- **CWE catalog version:** 4.21

## Description

The product manages a group of objects or resources and performs a separate memory allocation for each object, but it does not properly limit the total amount of memory that is consumed by all of the combined objects.

While the product might limit the amount of memory that is allocated in a single operation for a single object (such as a malloc of an array), if an attacker can cause multiple objects to be allocated in separate operations, then this might cause higher total memory consumption than the developer intended, leading to a denial of service.

## Alternate terms

- **Stack Exhaustion:** When a weakness allocates excessive memory on the stack, it is often described as "stack exhaustion," which is a technical impact of the weakness. This technical impact is often encountered as a consequence of CWE-789 and/or CWE-1325.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Languages:** C (Undetermined), C++ (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Availability | DoS: Resource Consumption (Memory) | Not controlling memory allocation can result in a request for too much system memory, possibly leading to a crash of the application due to out-of-memory conditions, or the consumption of a large amount of memory on the system. |

## Potential mitigations

### Implementation

Ensure multiple allocations of the same kind of object are properly tracked - possibly across multiple sessions, requests, or messages. Define an appropriate strategy for handling requests that exceed the limit, and consider supporting a configuration option so that the administrator can extend the amount of memory to be used if necessary.

### Operation

Run the program using system-provided resource limits for memory. This might still cause the program to crash or exit, but the impact to the rest of the system will be minimized.

## Demonstrative examples

### Example 1

This example contains a small allocation of stack memory. When the program was first constructed, the number of times this memory was allocated was probably inconsequential and presented no problem. Over time, as the number of objects in the database grow, the number of allocations will grow - eventually consuming the available stack, i.e. "stack exhaustion." An attacker who is able to add elements to the database could cause stack exhaustion more rapidly than assumed by the developer.

Bad code:

```c
// Gets the size from the number of objects in a database, which over time can conceivably get very large
int end_limit = get_nmbr_obj_from_db();
int i;
int *base = NULL;
int *p =base;
for (i = 0; i < end_limit; i++)
{
    *p = alloca(sizeof(int *)); // Allocate memory on the stack
    p = *p; // // Point to the next location to be saved
}
```

Since this uses alloca(), it allocates memory directly on the stack. If end\_limit is large enough, then the stack can be entirely consumed.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2020-36049 | JavaScript-based packet decoder uses concatenation of many small strings, causing out-of-memory (OOM) condition |
| CVE-2019-20176 | Product allocates a new buffer on the stack for each file in a directory, allowing stack exhaustion |
| CVE-2013-1591 | Chain: an integer overflow (CWE-190) in the image size calculation causes an infinite loop (CWE-835) which sequentially allocates buffers without limits (CWE-1325) until the stack is full. |

## Real CVEs with this weakness (sample of 12 of 26)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2024-27796 | iOS and iPadOS: Voice Control - A user may be able to elevate privileges | high | 8.1 | - | No | 2024-05-13 |
| CVE-2024-27804 | tvOS: AppleAVD - An app may be able to cause unexpected system termination | high | 8.1 | - | No | 2024-05-13 |
| CVE-2026-34183 | Unbounded Memory Growth in the QUIC PATH\_CHALLENGE Handler | high | 7.5 | - | No | 2026-06-09 |
| CVE-2026-3201 | Improperly Controlled Sequential Memory Allocation in Wireshark | high | 7.5 | - | No | 2026-02-25 |
| CVE-2025-47908 | Denial of service via malicious preflight requests in github.com/rs/cors | high | 7.5 | - | No | 2025-08-06 |
| CVE-2025-2240 | Smallrye-fault-tolerance: smallrye fault tolerance | high | 7.5 | - | No | 2025-03-12 |
| CVE-2023-3341 | A stack exhaustion flaw in control channel code may cause named to terminate unexpectedly | high | 7.5 | - | No | 2023-09-20 |
| CVE-2021-43174 | gzip transfer encoding caused out-of-memory crash | high | 7.5 | - | No | 2021-11-09 |
| CVE-2026-13056 | A user with read access can cause a DoS by executing a specifically crafted query to consume a large amount of RAM | high | 7.1 | - | No | 2026-07-22 |
| CVE-2026-8199 | Post-auth memory exhaustion via bitwise match expressions | high | 7.1 | - | No | 2026-05-13 |
| CVE-2026-54081 | veraPDF Parser DoS via PostScript Type 1 Font Programs | medium | 6.9 | - | No | 2026-07-29 |
| CVE-2026-54080 | veraPDF Parser DoS via PostScript CMap Streams | medium | 6.9 | - | No | 2026-07-29 |

## Related attack patterns (CAPEC)

- [CAPEC-130](https://radicalnotion.ai/capec/capec-130): Excessive Allocation

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-770](https://radicalnotion.ai/cwe/cwe-770) | Allocation of Resources Without Limits or Throttling |
| Peer | [CWE-789](https://radicalnotion.ai/cwe/cwe-789) | Memory Allocation with Excessive Size Value |
| Can precede | [CWE-476](https://radicalnotion.ai/cwe/cwe-476) | NULL Pointer Dereference |

## Frequently asked questions

### What is CWE-1325?

The product manages a group of objects or resources and performs a separate memory allocation for each object, but it does not properly limit the total amount of memory that is consumed by all of the combined objects.

### What CVEs are caused by CWE-1325?

26 recorded CVEs are attributed to CWE-1325, including CVE-2024-27796, CVE-2024-27804 and CVE-2026-34183.

### How do you prevent CWE-1325?

Ensure multiple allocations of the same kind of object are properly tracked - possibly across multiple sessions, requests, or messages. Define an appropriate strategy for handling requests that exceed the limit, and consider supporting a configuration option so that the administrator can extend the amount of memory to be used if necessary.

### What are the consequences of CWE-1325?

Exploiting CWE-1325 can lead to: DoS: Resource Consumption (Memory).

### Is CWE-1325 actively exploited?

26 recorded CVEs are caused by CWE-1325; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/1325.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-1325). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
