Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS03Nzg3LXA3eDYtZnEzas4AA3oi
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
- Rust canisters using candid
< 0.9.0
or>= 0.9.10
- Rust canister interfaces of type other than
record { * }
- Motoko based canisters
- dfx (for asset canister)
<= 0.14.3
or>= 0.15.2
Patches
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
- dfinity/candid/pull/478
- Candid Library Reference
- Candid Specification
- Internet Computer Specification
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS03Nzg3LXA3eDYtZnEzas4AA3oi
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 12 months ago
Updated: 12 months ago
CVSS Score: 7.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Identifiers: GHSA-7787-p7x6-fq3j, CVE-2023-6245
References:
- https://github.com/dfinity/candid/security/advisories/GHSA-7787-p7x6-fq3j
- https://github.com/dfinity/candid/pull/478
- https://github.com/dfinity/candid/commit/b233dbc2d2bcc79c9fc574dd5968269df680b073
- https://nvd.nist.gov/vuln/detail/CVE-2023-6245
- https://github.com/dfinity/candid/blob/master/spec/Candid.md
- https://internetcomputer.org/docs/current/references/candid-ref
- https://internetcomputer.org/docs/current/references/ic-interface-spec
- https://rustsec.org/advisories/RUSTSEC-2023-0073.html
- https://github.com/advisories/GHSA-7787-p7x6-fq3j
Blast Radius: 16.7
Affected Packages
cargo:candid
Dependent packages: 139Dependent repositories: 169
Downloads: 2,559,380 total
Affected Version Ranges: >= 0.9.0, < 0.9.10
Fixed in: 0.9.10
All affected versions: 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9
All unaffected versions: 0.1.0, 0.1.1, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.4.2, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.6.7, 0.6.8, 0.6.9, 0.6.10, 0.6.11, 0.6.12, 0.6.13, 0.6.14, 0.6.15, 0.6.16, 0.6.17, 0.6.18, 0.6.19, 0.6.20, 0.6.21, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.7.7, 0.7.8, 0.7.9, 0.7.10, 0.7.11, 0.7.12, 0.7.13, 0.7.14, 0.7.15, 0.7.16, 0.7.17, 0.7.18, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.10, 0.9.11, 0.10.0, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.5, 0.10.6, 0.10.7, 0.10.8, 0.10.9, 0.10.10