candid
Affected
- introduced
0.9.0, fixed0.9.10(semver)
Fixed versions
0.9.10
Fix
- Fixed version
0.9.10cargo update -p candid --precise 0.9.10
Advisory
Also known as: CVE-2023-6245, RUSTSEC-2023-0073
Candid infinite decoding loop through specially crafted payload
Impact
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.
Unaffected
< 0.9.0 or >= 0.9.10 record { * }<= 0.14.3 or >= 0.15.2Patches
The issue has been patched in 0.9.10. All rust based canisters on candid versions >= 0.9.0 must upgrade their candid versions to >= 0.9.10 and deploy their canisters to mainnet as soon as possible.
Workarounds
There is no workaround for canisters using the affected versions of candid other than upgrading to patched version.
References
High Basis: The source's own band: HIGH
0.9.0, fixed 0.9.10 (semver)0.9.10
0.9.10cargo update -p candid --precise 0.9.10Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0