CVE-2024-7884
IC Canister ic_cdk Memory Leak
Description
When a canister method is called via ic_cdk::call* , a new Future CallFuture is created and can be awaited by the caller to get the execution result. Internally, the state of the Future is tracked and stored in a struct called CallFutureState. A bug in the polling implementation of the CallFuture allows multiple references to be held for this internal state and not all references were dropped before the Future is resolved. Since we have unaccounted references held, a copy of the internal state ended up being persisted in the canister's heap and thus causing a memory leak. Impact Canisters built in Rust with ic_cdk and ic_cdk_timers are affected. If these canisters call a canister method, use timers or heartbeat, they will likely leak a small amount of memory on every such operation. In the worst case, this could lead to heap memory exhaustion triggered by an attacker. Motoko based canisters are not affected by the bug. PatchesThe patch has been backported to all minor versions between >= 0.8.0, <= 0.15.0. The patched versions available are 0.8.2, 0.9.3, 0.10.1, 0.11.6, 0.12.2, 0.13.5, 0.14.1, 0.15.1 and their previous versions have been yanked. WorkaroundsThere are no known workarounds at the moment. Developers are recommended to upgrade their canister as soon as possible to the latest available patched version of ic_cdk to avoid running out of Wasm heap memory. Upgrading the canisters (without updating `ic_cdk`) also frees the leaked memory but it's only a temporary solution.
INFO
Published Date :
Sept. 5, 2024, 1:15 p.m.
Last Modified :
Sept. 12, 2024, 8:47 p.m.
Source :
6b35d637-e00f-4228-858c-b20ad6e1d07b
Remotely Exploitable :
Yes !
Impact Score :
3.6
Exploitability Score :
3.9
Affected Products
The following products are affected by CVE-2024-7884
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.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2024-7884
.
URL | Resource |
---|---|
https://docs.rs/ic-cdk/latest/ic_cdk/ | Product |
https://github.com/dfinity/cdk-rs/pull/509 | Issue Tracking Patch |
https://internetcomputer.org/docs/current/references/ic-interface-spec | Product |
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-7884
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2024-7884
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]
Sep. 12, 2024
Action Type Old Value New Value Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H Changed Reference Type https://docs.rs/ic-cdk/latest/ic_cdk/ No Types Assigned https://docs.rs/ic-cdk/latest/ic_cdk/ Product Changed Reference Type https://github.com/dfinity/cdk-rs/pull/509 No Types Assigned https://github.com/dfinity/cdk-rs/pull/509 Issue Tracking, Patch Changed Reference Type https://internetcomputer.org/docs/current/references/ic-interface-spec No Types Assigned https://internetcomputer.org/docs/current/references/ic-interface-spec Product Added CWE NIST CWE-401 Added CPE Configuration OR *cpe:2.3:a:dfinity:canister_developer_kit_for_the_internet_computer:*:*:*:*:*:rust:*:* versions from (including) 0.8.0 up to (excluding) 0.8.2 *cpe:2.3:a:dfinity:canister_developer_kit_for_the_internet_computer:*:*:*:*:*:rust:*:* versions from (including) 0.9.0 up to (excluding) 0.9.3 *cpe:2.3:a:dfinity:canister_developer_kit_for_the_internet_computer:0.10.0:*:*:*:*:rust:*:* *cpe:2.3:a:dfinity:canister_developer_kit_for_the_internet_computer:*:*:*:*:*:rust:*:* versions from (including) 0.11.0 up to (excluding) 0.11.6 *cpe:2.3:a:dfinity:canister_developer_kit_for_the_internet_computer:*:*:*:*:*:rust:*:* versions from (including) 0.12.0 up to (excluding) 0.12.2 *cpe:2.3:a:dfinity:canister_developer_kit_for_the_internet_computer:*:*:*:*:*:rust:*:* versions from (including) 0.13.0 up to (excluding) 0.13.5 *cpe:2.3:a:dfinity:canister_developer_kit_for_the_internet_computer:0.14.0:*:*:*:*:rust:*:* *cpe:2.3:a:dfinity:canister_developer_kit_for_the_internet_computer:0.15.0:*:*:*:*:rust:*:* -
CVE Received by 6b35d637-e00f-4228-858c-b20ad6e1d07b
Sep. 05, 2024
Action Type Old Value New Value Added Description When a canister method is called via ic_cdk::call* , a new Future CallFuture is created and can be awaited by the caller to get the execution result. Internally, the state of the Future is tracked and stored in a struct called CallFutureState. A bug in the polling implementation of the CallFuture allows multiple references to be held for this internal state and not all references were dropped before the Future is resolved. Since we have unaccounted references held, a copy of the internal state ended up being persisted in the canister's heap and thus causing a memory leak. Impact Canisters built in Rust with ic_cdk and ic_cdk_timers are affected. If these canisters call a canister method, use timers or heartbeat, they will likely leak a small amount of memory on every such operation. In the worst case, this could lead to heap memory exhaustion triggered by an attacker. Motoko based canisters are not affected by the bug. PatchesThe patch has been backported to all minor versions between >= 0.8.0, <= 0.15.0. The patched versions available are 0.8.2, 0.9.3, 0.10.1, 0.11.6, 0.12.2, 0.13.5, 0.14.1, 0.15.1 and their previous versions have been yanked. WorkaroundsThere are no known workarounds at the moment. Developers are recommended to upgrade their canister as soon as possible to the latest available patched version of ic_cdk to avoid running out of Wasm heap memory. Upgrading the canisters (without updating `ic_cdk`) also frees the leaked memory but it's only a temporary solution. Added Reference DFINITY Foundation https://github.com/dfinity/cdk-rs/pull/509 [No types assigned] Added Reference DFINITY Foundation https://docs.rs/ic-cdk/latest/ic_cdk/ [No types assigned] Added Reference DFINITY Foundation https://internetcomputer.org/docs/current/references/ic-interface-spec [No types assigned] Added CWE DFINITY Foundation CWE-401 Added CVSS V3.1 DFINITY Foundation AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
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-7884
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-7884
weaknesses.