RUSTSEC-2023-0073

Source
https://rustsec.org/advisories/RUSTSEC-2023-0073
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2023-0073.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2023-0073
Aliases
Published
2023-12-08T12:00:00Z
Modified
2023-12-09T10:26:19.388920Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Infinite decoding loop through specially crafted payload
Details

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

References

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / candid

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.9.0
Fixed
0.9.10

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [
            "candid::Decode"
        ],
        "arch": []
    }
}

Database specific

{
    "cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
    "informational": null,
    "categories": [
        "denial-of-service"
    ]
}