Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. ic_cdk
  4. ›
  5. CVE-2024-7884

CVE-2024-7884: ic-cdk has a memory leak when calling a canister method via `ic_cdk::call`

September 5, 2024

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.

References

  • docs.rs/ic-cdk/latest/ic_cdk
  • github.com/advisories/GHSA-rwq6-crjg-9cpw
  • github.com/dfinity/cdk-rs
  • github.com/dfinity/cdk-rs/pull/509
  • github.com/dfinity/cdk-rs/security/advisories/GHSA-rwq6-crjg-9cpw
  • internetcomputer.org/docs/current/references/ic-interface-spec
  • nvd.nist.gov/vuln/detail/CVE-2024-7884

Code Behaviors & Features

Detect and mitigate CVE-2024-7884 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.8.0 before 0.8.2, all versions starting from 0.9.0 before 0.9.3, all versions starting from 0.10.0 before 0.10.1, all versions starting from 0.11.0 before 0.11.6, all versions starting from 0.12.0 before 0.12.2, all versions starting from 0.13.0 before 0.13.5, all versions starting from 0.14.0 before 0.14.1, all versions starting from 0.15.0 before 0.15.1

Fixed versions

  • 0.8.2
  • 0.9.3
  • 0.10.1
  • 0.11.6
  • 0.12.2
  • 0.13.5
  • 0.14.1
  • 0.15.1

Solution

Upgrade to versions 0.10.1, 0.11.6, 0.12.2, 0.13.5, 0.14.1, 0.15.1, 0.8.2, 0.9.3 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-401: Missing Release of Memory after Effective Lifetime

Source file

cargo/ic_cdk/CVE-2024-7884.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:32 +0000.