Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. candid
  4. ›
  5. CVE-2023-6245

CVE-2023-6245: Candid infinite decoding loop through specially crafted payload

December 8, 2023

The Candid library causes a Denial of Service while parsing a specially crafted payload with empty data type. For example, if the payload is record { * ; empty } and the canister interface expects record { * } then the rust candid decoder treats empty as an extra field required by the type. The problem with type empty is that the candid rust library wrongly categorizes empty as a recoverable error when skipping the field and thus causing an infinite decoding loop.

Canisters using affected versions of candid are exposed to denial of service by causing the decoding to run indefinitely until the canister traps due to reaching maximum instruction limit per execution round. Repeated exposure to the payload will result in degraded performance of the canister.

For asset canister users, dfx versions >= 0.14.4 to <= 0.15.2-beta.0 ships asset canister with an affected version of candid.

References

  • github.com/advisories/GHSA-7787-p7x6-fq3j
  • github.com/dfinity/candid
  • github.com/dfinity/candid/blob/master/spec/Candid.md
  • github.com/dfinity/candid/commit/b233dbc2d2bcc79c9fc574dd5968269df680b073
  • github.com/dfinity/candid/pull/478
  • github.com/dfinity/candid/security/advisories/GHSA-7787-p7x6-fq3j
  • internetcomputer.org/docs/current/references/candid-ref
  • internetcomputer.org/docs/current/references/ic-interface-spec
  • nvd.nist.gov/vuln/detail/CVE-2023-6245
  • rustsec.org/advisories/RUSTSEC-2023-0073.html

Code Behaviors & Features

Detect and mitigate CVE-2023-6245 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.9.0 before 0.9.10

Fixed versions

  • 0.9.10

Solution

Upgrade to version 0.9.10 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-1288: Improper Validation of Consistency within Input
  • CWE-400: Uncontrolled Resource Consumption
  • CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')

Source file

cargo/candid/CVE-2023-6245.yml

Spotted a mistake? Edit the file on GitLab.

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

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