Vulnerabilites related to Internet Computer - Candid
CVE-2023-6245 (GCVE-0-2023-6245)
Vulnerability from cvelistv5
Published
2023-12-08 14:26
Modified
2024-12-02 14:33
Severity ?
VLAI Severity ?
EPSS score ?
CWE
Summary
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.
References
Impacted products
Vendor | Product | Version | ||
---|---|---|---|---|
Internet Computer | Candid |
Version: 0.9.0 |
{ "containers": { "adp": [ { "providerMetadata": { "dateUpdated": "2024-08-02T08:21:17.978Z", "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE" }, "references": [ { "tags": [ "x_transferred" ], "url": "https://github.com/dfinity/candid/pull/478" }, { "tags": [ "x_transferred" ], "url": "https://internetcomputer.org/docs/current/references/candid-ref" }, { "tags": [ "x_transferred" ], "url": "https://github.com/dfinity/candid/blob/master/spec/Candid.md" }, { "tags": [ "x_transferred" ], "url": "https://github.com/dfinity/candid/security/advisories/GHSA-7787-p7x6-fq3j" }, { "tags": [ "x_transferred" ], "url": "https://internetcomputer.org/docs/current/references/ic-interface-spec" } ], "title": "CVE Program Container" }, { "metrics": [ { "other": { "content": { "id": "CVE-2023-6245", "options": [ { "Exploitation": "none" }, { "Automatable": "yes" }, { "Technical Impact": "partial" } ], "role": "CISA Coordinator", "timestamp": "2024-12-02T14:31:05.379872Z", "version": "2.0.3" }, "type": "ssvc" } } ], "providerMetadata": { "dateUpdated": "2024-12-02T14:33:16.496Z", "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "shortName": "CISA-ADP" }, "title": "CISA ADP Vulnrichment" } ], "cna": { "affected": [ { "defaultStatus": "unaffected", "product": "Candid", "repo": "https://github.com/dfinity/candid", "vendor": "Internet Computer", "versions": [ { "lessThan": "0.9.10", "status": "affected", "version": "0.9.0", "versionType": "0.0.0" } ] } ], "datePublic": "2023-12-08T01:55:00.000Z", "descriptions": [ { "lang": "en", "supportingMedia": [ { "base64": false, "type": "text/html", "value": "\u003cp\u003eThe Candid library causes a Denial of Service while \nparsing a specially crafted payload with \u0027empty\u0027 data type. For example,\n if the payload is \u003ccode\u003e`record { * ; empty }`\u003c/code\u003e and the canister interface expects \u003ccode\u003e`record { * }`\u003c/code\u003e then the Rust candid decoder treats \u003ccode\u003eempty\u003c/code\u003e as an extra field required by the type. The problem with the type \u003ccode\u003eempty\u003c/code\u003e is that the candid Rust library wrongly categorizes \u003ccode\u003eempty\u003c/code\u003e as a recoverable error when skipping the field and thus causing an infinite decoding loop.\u003c/p\u003e\n\u003cp\u003eCanisters using affected versions of candid\n are exposed to denial of service by causing the decoding to run \nindefinitely until the canister traps due to reaching maximum \ninstruction limit per execution round. Repeated exposure to the payload \nwill result in degraded performance of the canister. Note: Canisters written in Motoko are unaffected.\u003cbr\u003e\u003c/p\u003e\u003cbr\u003e" } ], "value": "The Candid library causes a Denial of Service while \nparsing a specially crafted payload with \u0027empty\u0027 data type. For example,\n 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.\n\n\nCanisters using affected versions of candid\n are exposed to denial of service by causing the decoding to run \nindefinitely until the canister traps due to reaching maximum \ninstruction limit per execution round. Repeated exposure to the payload \nwill result in degraded performance of the canister. Note: Canisters written in Motoko are unaffected.\n\n\n\n" } ], "impacts": [ { "descriptions": [ { "lang": "en", "value": "Denial of Service" } ] } ], "metrics": [ { "cvssV3_1": { "attackComplexity": "LOW", "attackVector": "NETWORK", "availabilityImpact": "HIGH", "baseScore": 7.5, "baseSeverity": "HIGH", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "privilegesRequired": "NONE", "scope": "UNCHANGED", "userInteraction": "NONE", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "version": "3.1" }, "format": "CVSS", "scenarios": [ { "lang": "en", "value": "GENERAL" } ] } ], "problemTypes": [ { "descriptions": [ { "cweId": "CWE-835", "description": "CWE-835 Loop with Unreachable Exit Condition (\u0027Infinite Loop\u0027)", "lang": "en", "type": "CWE" } ] }, { "descriptions": [ { "cweId": "CWE-1288", "description": "CWE-1288 Improper Validation of Consistency within Input", "lang": "en", "type": "CWE" } ] }, { "descriptions": [ { "cweId": "CWE-168", "description": "CWE-168 Improper Handling of Inconsistent Special Elements", "lang": "en", "type": "CWE" } ] }, { "descriptions": [ { "cweId": "CWE-20", "description": "CWE-20 Improper Input Validation", "lang": "en", "type": "CWE" } ] } ], "providerMetadata": { "dateUpdated": "2023-12-08T14:26:09.331Z", "orgId": "6b35d637-e00f-4228-858c-b20ad6e1d07b", "shortName": "Dfinity" }, "references": [ { "url": "https://github.com/dfinity/candid/pull/478" }, { "url": "https://internetcomputer.org/docs/current/references/candid-ref" }, { "url": "https://github.com/dfinity/candid/blob/master/spec/Candid.md" }, { "url": "https://github.com/dfinity/candid/security/advisories/GHSA-7787-p7x6-fq3j" }, { "url": "https://internetcomputer.org/docs/current/references/ic-interface-spec" } ], "source": { "discovery": "INTERNAL" }, "title": "Infinite decoding loop through specially crafted payload", "x_generator": { "engine": "Vulnogram 0.1.0-dev" } } }, "cveMetadata": { "assignerOrgId": "6b35d637-e00f-4228-858c-b20ad6e1d07b", "assignerShortName": "Dfinity", "cveId": "CVE-2023-6245", "datePublished": "2023-12-08T14:26:09.331Z", "dateReserved": "2023-11-21T16:28:51.715Z", "dateUpdated": "2024-12-02T14:33:16.496Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1" }