7.5
HIGH CVSS 3.1
CVE-2024-4435
BTreeMap memory leak when deallocating nodes with overflows
Description

When storing unbounded types in a BTreeMap, a node is represented as a linked list of "memory chunks". It was discovered recently that when we deallocate a node, in some cases only the first memory chunk is deallocated, and the rest of the memory chunks remain (incorrectly) allocated, causing a memory leak. In the worst case, depending on how a canister uses the BTreeMap, an adversary could interact with the canister through its API and trigger interactions with the map that keep consuming memory due to the memory leak. This could potentially lead to using an excessive amount of memory, or even running out of memory. This issue has been fixed in #212 https://github.com/dfinity/stable-structures/pull/212  by changing the logic for deallocating nodes to ensure that all of a node's memory chunks are deallocated and users are asked to upgrade to version 0.6.4.. Tests have been added to prevent regressions of this nature moving forward. Note: Users of stable-structure < 0.6.0 are not affected. Users who are not storing unbounded types in BTreeMap are not affected and do not need to upgrade. Otherwise, an upgrade to version 0.6.4 is necessary.

INFO

Published Date :

May 21, 2024, 10:15 a.m.

Last Modified :

Dec. 10, 2025, 5:12 p.m.

Remotely Exploit :

Yes !

Source :

6b35d637-e00f-4228-858c-b20ad6e1d07b
Affected Products

The following products are affected by CVE-2024-4435 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Dfinity stable_structures
CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 3.1 MEDIUM 6b35d637-e00f-4228-858c-b20ad6e1d07b
CVSS 3.1 HIGH [email protected]
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2024-4435 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2024-4435 weaknesses.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2024-4435 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2024-4435 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • Initial Analysis by [email protected]

    Dec. 10, 2025

    Action Type Old Value New Value
    Added CVSS V3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
    Added CPE Configuration OR *cpe:2.3:a:dfinity:stable_structures:*:*:*:*:*:rust:*:* versions up to (excluding) 0.6.0
    Added Reference Type CVE: https://docs.rs/ic-stable-structures/0.6.4/ic_stable_structures/ Types: Product
    Added Reference Type DFINITY Foundation: https://docs.rs/ic-stable-structures/0.6.4/ic_stable_structures/ Types: Product
    Added Reference Type CVE: https://github.com/dfinity/stable-structures/pull/212 Types: Issue Tracking, Patch
    Added Reference Type DFINITY Foundation: https://github.com/dfinity/stable-structures/pull/212 Types: Issue Tracking, Patch
    Added Reference Type CVE: https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/storage#stable-memory Types: Product
    Added Reference Type DFINITY Foundation: https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/storage#stable-memory Types: Product
  • CVE Modified by af854a3a-2127-422b-91ae-364da2661108

    Nov. 21, 2024

    Action Type Old Value New Value
    Added Reference https://docs.rs/ic-stable-structures/0.6.4/ic_stable_structures/
    Added Reference https://github.com/dfinity/stable-structures/pull/212
    Added Reference https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/storage#stable-memory
  • CVE Received by 6b35d637-e00f-4228-858c-b20ad6e1d07b

    May. 21, 2024

    Action Type Old Value New Value
    Added Description When storing unbounded types in a BTreeMap, a node is represented as a linked list of "memory chunks". It was discovered recently that when we deallocate a node, in some cases only the first memory chunk is deallocated, and the rest of the memory chunks remain (incorrectly) allocated, causing a memory leak. In the worst case, depending on how a canister uses the BTreeMap, an adversary could interact with the canister through its API and trigger interactions with the map that keep consuming memory due to the memory leak. This could potentially lead to using an excessive amount of memory, or even running out of memory. This issue has been fixed in #212 https://github.com/dfinity/stable-structures/pull/212  by changing the logic for deallocating nodes to ensure that all of a node's memory chunks are deallocated and users are asked to upgrade to version 0.6.4.. Tests have been added to prevent regressions of this nature moving forward. Note: Users of stable-structure < 0.6.0 are not affected. Users who are not storing unbounded types in BTreeMap are not affected and do not need to upgrade. Otherwise, an upgrade to version 0.6.4 is necessary.
    Added Reference DFINITY Foundation https://github.com/dfinity/stable-structures/pull/212 [No types assigned]
    Added Reference DFINITY Foundation https://docs.rs/ic-stable-structures/0.6.4/ic_stable_structures/ [No types assigned]
    Added Reference DFINITY Foundation https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/storage#stable-memory [No types assigned]
    Added CWE DFINITY Foundation CWE-401
    Added CVSS V3.1 DFINITY Foundation AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
Vulnerability Scoring Details
Base CVSS Score: 7.5
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality Impact
Integrity Impact
Availability Impact