CVE-2023-6245

7.5 HIGH

📋 TL;DR

The Candid library vulnerability allows attackers to cause Denial of Service by sending specially crafted payloads that trigger infinite decoding loops in Rust-based canisters. This affects Internet Computer canisters using vulnerable versions of the Candid library, potentially degrading performance or causing execution traps. Motoko-based canisters are unaffected.

💻 Affected Systems

Products:
  • Candid library for Rust
  • Internet Computer canisters using Candid
Versions: Candid versions before the fix in PR #478
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Rust-based canisters using Candid for decoding. Motoko canisters are unaffected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Canister becomes completely unresponsive due to infinite decoding loops, causing persistent denial of service and potential resource exhaustion.

🟠

Likely Case

Degraded canister performance with repeated payload exposure, leading to instruction limit traps and service disruption.

🟢

If Mitigated

Minimal impact with patched versions or proper input validation in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploit requires sending specially crafted Candid payloads to vulnerable canisters.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Candid library with PR #478 applied

Vendor Advisory: https://github.com/dfinity/candid/security/advisories/GHSA-7787-p7x6-fq3j

Restart Required: Yes

Instructions:

1. Update Candid dependency to patched version. 2. Rebuild and redeploy affected canisters. 3. Verify the fix by testing with malicious payloads.

🔧 Temporary Workarounds

Input validation filter

all

Implement custom input validation to reject payloads containing 'empty' type in unexpected positions

🧯 If You Can't Patch

  • Implement rate limiting on canister calls to reduce impact of repeated attacks
  • Deploy canister monitoring to detect abnormal instruction consumption patterns

🔍 How to Verify

Check if Vulnerable:

Check Candid library version in Cargo.toml or lock file against patched versions

Check Version:

grep -i candid Cargo.toml || grep candid Cargo.lock

Verify Fix Applied:

Test canister with payload 'record { * ; empty }' against expected type 'record { * }' - should not cause infinite loop

📡 Detection & Monitoring

Log Indicators:

  • Canister traps due to instruction limit exceeded
  • Abnormally long decoding times

Network Indicators:

  • Repeated calls with similar payload patterns
  • Unusually large number of canister calls from single source

SIEM Query:

canister_trap_reason:"instruction limit" AND canister_language:"rust"

🔗 References

📤 Share & Export