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

High 7.5 Published Updated

Attackers can cause a denial of service in Internet Computer canisters by sending crafted payloads that trigger an infinite decoding loop in the Candid library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-6245?

CVE-2023-6245 is a high-severity denial of service vulnerability in Internet Computer Candid, published on 8 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-20, CWE-835, CWE-168, CWE-1288

Which versions are affected by CVE-2023-6245?

3 open source packages ship an affected version, including candid. It affects 1 product.

PackageAffectedFixed in
candid crates.ioFrom 0.9.00.9.10
candid crates.ioFrom 0.9.00.9.10
candid crates.ioFrom 0.9.00.9.10

Products include Dfinity Candid.

How do I fix CVE-2023-6245?

Upgrade candid to 0.9.10 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2023-6245 being exploited?

There is no known exploitation of CVE-2023-6245 in the wild and no public exploit code.

Sources

Also known as GHSA-7787-p7x6-fq3j, RUSTSEC-2023-0073.

Is CVE-2023-6245 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free