CVE-2024-7884

7.5 HIGH

📋 TL;DR

A memory leak vulnerability in Rust-based Internet Computer canisters using ic_cdk and ic_cdk_timers allows unaccounted references to persist in heap memory. This affects canisters that call methods, use timers, or heartbeat functions, potentially leading to heap exhaustion. Motoko-based canisters are not affected.

💻 Affected Systems

Products:
  • ic_cdk
  • ic_cdk_timers
Versions: >=0.8.0, <=0.15.0 (excluding patched versions)
Operating Systems: All (Wasm-based)
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Rust-based Internet Computer canisters. Motoko canisters are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker could trigger repeated operations to exhaust heap memory, causing canister failure and denial of service.

🟠

Likely Case

Gradual memory accumulation over time leading to performance degradation and eventual canister instability.

🟢

If Mitigated

With patched versions, no memory leak occurs and canisters operate normally.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires calling vulnerable canister methods, which may be accessible depending on canister design.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.8.2, 0.9.3, 0.10.1, 0.11.6, 0.12.2, 0.13.5, 0.14.1, 0.15.1

Vendor Advisory: https://github.com/dfinity/cdk-rs/pull/509

Restart Required: Yes

Instructions:

1. Update Cargo.toml to use patched ic_cdk version. 2. Rebuild and redeploy canister. 3. Verify memory usage stabilizes.

🔧 Temporary Workarounds

Canister Upgrade

all

Upgrading canisters temporarily frees leaked memory but doesn't prevent future leaks

dfx canister install --mode upgrade <canister_name>

🧯 If You Can't Patch

  • Monitor canister memory usage closely and upgrade canisters periodically to clear accumulated memory
  • Limit external calls to vulnerable canisters and implement rate limiting where possible

🔍 How to Verify

Check if Vulnerable:

Check Cargo.toml for ic_cdk version between 0.8.0-0.15.0 (excluding patched versions)

Check Version:

grep ic_cdk Cargo.toml

Verify Fix Applied:

Monitor canister memory usage after patch - should stabilize instead of continuously increasing

📡 Detection & Monitoring

Log Indicators:

  • Unusual memory growth patterns
  • Canister out-of-memory errors

Network Indicators:

  • Increased call frequency to vulnerable canister methods

SIEM Query:

memory_usage > threshold AND canister_type = 'rust' AND ic_cdk_version in vulnerable_range

🔗 References

📤 Share & Export