Infinite decoding loop through specially crafted payload
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
candidcrates.io | >= 0.9.0, < 0.9.10 | 0.9.10 |
Affected products
2- Internet Computer/Candidv5Range: 0.9.0
Patches
Vulnerability mechanics
References
9- github.com/advisories/GHSA-7787-p7x6-fq3jghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-6245ghsaADVISORY
- github.com/dfinity/candid/blob/master/spec/Candid.mdghsaWEB
- github.com/dfinity/candid/commit/b233dbc2d2bcc79c9fc574dd5968269df680b073ghsaWEB
- github.com/dfinity/candid/pull/478ghsaWEB
- github.com/dfinity/candid/security/advisories/GHSA-7787-p7x6-fq3jghsaWEB
- internetcomputer.org/docs/current/references/candid-refghsaWEB
- internetcomputer.org/docs/current/references/ic-interface-specghsaWEB
- rustsec.org/advisories/RUSTSEC-2023-0073.htmlghsaWEB
News mentions
0No linked articles in our index yet.