CVE-2024-4435
published medium CVSS 3.1 · 5.9BTreeMap memory leak when deallocating nodes with overflows
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Internet Computer | — | ic-stable-structures0.6.0 to < 0.6.4 · Other versions: unaffected | Affected | Not stated | Dfinity |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 5.9 / 10
- Severity
- medium
- Provider
- Dfinity · cna
- Vector string
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Internet Computer | ic-stable-structures | 0.6.0 to < 0.6.4 (affected · semver)Default: unaffected | Dfinity · cna |
Weaknesses
1- CWE-401 CWE-401 Missing Release of Memory after Effective Lifetime
References
3Provider assertions
3Dfinity · cna
BTreeMap memory leak when deallocating nodes with overflows
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 0aed19ae20dd477bfd631fbf5aef07113a053be97c1632bf209128008cd4e4ed
- Ingested
- 23 Sep 2026, 08:29:37 UTC
- Source record
- Official CVE record