CVE-2023-34449 ink! vulnerable to incorrect decoding of storage value when using `DelegateCall`
Incorrect decoding of storage values during delegate calls in ink! smart contracts can lead to data integrity issues or unexpected behavior.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-34449?
CVE-2023-34449 is a medium-severity vulnerability in paritytech ink, published on 14 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
ink! is an embedded domain specific language to write smart contracts in Rust for blockchains built on the Substrate framework. Starting in version 4.0.0 and prior to version 4.2.1, the return value when using delegate call mechanics, either through `CallBuilder::delegate` or `ink_env::invoke_contract_delegate`, is decoded incorrectly. This bug was related to the mechanics around decoding a call's return buffer, which was changed as part of pull request 1450. Since this feature was only released in ink! 4.0.0, no previous versions are affected. Users who have an ink! 4.x series contract should upgrade to 4.2.1 to receive a patch.
Which versions are affected by CVE-2023-34449?
4 open source packages ship an affected version, including ink and ink_env. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
ink crates.io | From 4.0.0 | 4.2.1 |
ink crates.io | From 4.0.0 | 4.2.1 |
ink_env crates.io | From 4.0.0 | 4.2.1 |
ink_env crates.io | From 4.0.0 | 4.2.1 |
Products include Parity Ink\!.
How do I fix CVE-2023-34449?
Upgrade ink to 4.2.1 or later.
Is CVE-2023-34449 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-34449 exists.
Sources
Also known as GHSA-853p-5678-hv8f.