CVE-2023-6245: Infinite decoding loop through specially crafted payload

7.5 CVSS

Description

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 the 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. Note: Canisters written in Motoko are unaffected.

Classification

CVE ID: CVE-2023-6245

CVSS Base Severity: HIGH

CVSS Base Score: 7.5

Affected Products

Vendor: Internet Computer

Product: Candid

Exploit Prediction Scoring System (EPSS)

EPSS Score: 0.08% (probability of being exploited)

EPSS Percentile: 37.89% (scored less or equal to compared to others)

EPSS Date: 2025-02-03 (when was this score calculated)

References

https://github.com/dfinity/candid/pull/478
https://internetcomputer.org/docs/current/references/candid-ref
https://github.com/dfinity/candid/blob/master/spec/Candid.md
https://github.com/dfinity/candid/security/advisories/GHSA-7787-p7x6-fq3j
https://internetcomputer.org/docs/current/references/ic-interface-spec

Timeline