Candid · Candid · CVE-2023-6245
**Name of the Vulnerable Software and Affected Versions**
Candid versions 0.9.0 through 0.9.9
dfx versions 0.14.4 through 0.15.2-beta.0
**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, 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 the maximum instruction limit per execution round. Repeated exposure to the payload will result in degraded performance of the canister.
**Recommendations**
For Candid versions 0.9.0 through 0.9.9, upgrade the Candid version to 0.9.10 or later.
For dfx versions 0.14.4 through 0.15.2-beta.0, upgrade dfx to version 0.15.2 or later.
As a temporary workaround, consider restricting access to the vulnerable Candid library until a patch is available.