CyberSecBulletin
CVE-2024-7884NVD status: Analyzed

ic-cdk: Missing Release of Memory after Effective Lifetime

CVE-2024-7884 is a high-severity missing release of memory after effective lifetime vulnerability in ic-cdk from Internet Computer, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists versions 0.8.2, 0.9.3, 0.10.1 as the first without the flaw, so updating ic-cdk to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.69% chance of exploitation within 30 days, higher than 53% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update ic-cdk to 0.8.2 or 0.9.3 or 0.10.1 or 0.11.5, whichever matches your release line, or a later version.
  2. Update Canister Developer Kit For The Internet Computer to 0.8.2 or 0.9.3 or 0.11.6 or 0.12.2, whichever matches your release line, or a later version.
  3. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
Internet Computeric-cdk0.8.0 up to, but not including, 0.8.2; 0.9.0 up to, but not including, 0.9.3; 0.10.0 up to, but not including, 0.10.1; 0.11.0 up to, but not including, 0.11.5; 0.12.0 up to, but not including, 0.12.2; 0.13.0 up to, but not including, 0.13.4; 0.14.0 up to, but not including, 0.14.1; 0.15.0 up to, but not including, 0.15.10.8.2, 0.9.3, 0.10.1, 0.11.5, 0.12.2, 0.13.4
DfinityCanister Developer Kit For The Internet Computer0.8.0 up to, but not including, 0.8.2; 0.9.0 up to, but not including, 0.9.3; 0.11.0 up to, but not including, 0.11.6; 0.12.0 up to, but not including, 0.12.2; 0.13.0 up to, but not including, 0.13.5; 0.10.0; 0.14.0; 0.15.00.8.2, 0.9.3, 0.11.6, 0.12.2, 0.13.5

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
NoneNo data is disclosed.
Integrity
NoneNothing can be modified.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.5HighCNA
CVSS 3.17.5HighNVD

Official 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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Missing Release of Memory after Effective Lifetime

The product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse.

How developers prevent this class of flaw

  • Choose a language or tool that provides automatic memory management, or makes manual memory management less error-prone. For example, glibc in Linux provides protection against free of invalid pointers. When using Xcode to target OS X or iOS, enable automatic reference counting (ARC). To help correctly and consistently manage memory when programming in C++, consider using a smart pointer class such as std
  • Use an abstraction library to abstract away risky APIs. Not a complete solution.
  • Consider using the Boehm-Demers-Weiser garbage collector (bdwgc), which can help avoid leaks.

More Missing Release of Memory after Effective Lifetime vulnerabilities (CWE-401)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Patches and release notes

Recent Missing Release of Memory after Effective Lifetime vulnerabilities

Spotted an error? Tell us.