7.5high
Infinite decoding loop through specially crafted payload
- Severity
- 7.5high CVSS:3.1 by Dfinity
- Exploit likelihood
- 1.21% (higher than 69% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Dfinity
- Also known as
- GHSA-7787-p7x6-fq3jRUSTSEC-2023-0073
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Internet Computer Candid | from 0.9.0 before 0.9.10 | CVE List |
| candid (crates.io) | from 0.9.0 before 0.9.10 | GitHub Advisory Database, RustSec Advisory Database |
| dfinity candid | from 0.9.0 before 0.9.10 | NVD |
All scores
| Dfinity | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| RustSec Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.0or>= 0.9.10 - Rust canister interfaces of type other than
record { * } - Motoko based canisters
- dfx (for asset canister)
<= 0.14.3or>= 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
RustSec Advisory Database
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.0or>= 0.9.10 - Rust canister interfaces of type other than
record { * } - Motoko based canisters
- dfx (for asset canister)
<= 0.14.3or>= 0.15.2
References
NVD (es)
La librería Candid provoca una denegación de servicio mientras analiza un payload especialmente manipulado con un tipo de datos "vacío". Por ejemplo, si el payload es `record { * ; empty }` y la interfaz del recipiente espera `record { * }`, entonces el decodificador sincero de Rust trata el vacío como un campo adicional requerido por el tipo. El problema con el tipo vacío es que la sincera librería Rust clasifica erróneamente vacío como un error recuperable al omitir el campo y, por lo tanto, provoca un bucle de decodificación infinito. Los contenedores que utilizan versiones afectadas de candid están expuestos a una denegación de servicio al hacer que la decodificación se ejecute indefinidamente hasta que el contenedor se bloquea debido a que alcanza el límite máximo de instrucciones por ronda de ejecución. La exposición repetida a el payload dará como resultado un rendimiento degradado del recipiente. Nota: Los botes escritos en Motoko no se ven afectados.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-6245 changed 2024-12-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7787-p7x6-fq3j changed 2026-05-04 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2023-0073 changed 2023-12-09 | CC0-1.0 |
| NVD | CVE-2023-6245 changed 2026-06-17 | Public domain |