{"answers":{"affected":"3 open source packages ship an affected version, including ic-stable-structures. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-4435 in the wild and no public exploit code.","fix":"Upgrade ic-stable-structures to 0.6.4 or later.","what":"CVE-2024-4435 is a medium-severity denial of service vulnerability in Internet Computer ic-stable-structures, published on 21 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-4435 and fix it if it is affected.\n\nWhat it is: CVE-2024-4435 is a medium-severity denial of service vulnerability in Internet Computer ic-stable-structures, published on 21 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-4435 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- ic-stable-structures (crates.io): affected from 0.6.0; fixed in 0.6.4\n- ic-stable-structures (crates.io): affected from 0.6.0; fixed in 0.6.4\n- ic-stable-structures (crates.io): affected from 0.6.0; fixed in 0.6.4\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-4435/ (Markdown: https://insights.sbomify.com/CVE-2024-4435/index.md)","id":"CVE-2024-4435","markdown":"https://insights.sbomify.com/CVE-2024-4435/index.md","name":"CVE-2024-4435","record":{"aliases":["GHSA-3rcq-39xp-7xjp","RUSTSEC-2024-0406"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Rust stable structures library","requires_auth":"none","summary":"Attackers can trigger a memory leak in BTreeMap by storing unbounded types, leading to excessive memory consumption and potential denial of service.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"Dfinity","cpe":[{"product":"stable_structures","vendor":"dfinity"}],"cvss":{"score":5.9,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-401","name":"Missing Release of Memory after Effective Lifetime"}],"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.\n\nThis 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 \u003c 0.6.0 are not affected.\n\nUsers 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.","ecosystems":["crates.io"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"BTreeMap memory leak when deallocating nodes with overflows","id":"CVE-2024-4435","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"denial_of_service","year":"2024"},"n_packages":3,"n_references":3,"next":{"headline":"Etcd: incomplete fix for cve-2022-41723 in openstack platform","id":"CVE-2024-4436"},"packages":[{"ecosystem":"crates.io","fixed":["0.6.4"],"introduced":["0.6.0"],"last_affected":[],"package":"ic-stable-structures","purl":null,"source":"GHSA-3rcq-39xp-7xjp"},{"ecosystem":"crates.io","fixed":["0.6.4"],"introduced":["0.6.0"],"last_affected":[],"package":"ic-stable-structures","purl":"pkg:cargo/ic-stable-structures","source":"GHSA-3rcq-39xp-7xjp"},{"ecosystem":"crates.io","fixed":["0.6.4"],"introduced":["0.6.0"],"last_affected":[],"package":"ic-stable-structures","purl":"pkg:cargo/ic-stable-structures","source":"RUSTSEC-2024-0406"}],"prev":{"headline":"LearnPress – WordPress LMS Plugin \u003c= 4.2.6.5 - Unauthenticated Time-Based SQL Injection","id":"CVE-2024-4434"},"products":["ic-stable-structures"],"published":"2024-05-21","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-01","vendors":["Internet Computer"]},"summary":"Attackers can trigger a memory leak in BTreeMap by storing unbounded types, leading to excessive memory consumption and potential denial of service.","url":"https://insights.sbomify.com/CVE-2024-4435/"}