CVE-2023-34449 is a medium-severity (CVSS 5.3) CWE-253 vulnerability in ink. 3 public exploit references exist, so weaponization risk is real. A fix is available for ink — see the affected versions and patch details below.
ink! vulnerable to incorrect decoding of storage value when using `DelegateCall`
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for CVE-2023-34449.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2023-34449 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 388,997 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
ink🦀ink_envReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Summary
The return value when using delegate call mechanics, either through CallBuilder::delegate or ink_env::invoke_contract_delegate, is being decoded incorrectly.
Description
Consider this minimal example:
// First contract, this will be performing a delegate call to the `Callee`.
#[ink(storage)]
pub struct Caller {
value: u128,
}
#[ink(message)]
pub fn get_value(&self, callee_code_hash: Hash) -> u128 {
let result = build_call::<DefaultEnvironment>()
.delegate(callee_code_hash)
.exec_input(ExecutionInput::new(Selector::new(ink::selector_bytes!(
"get_value"
))))
.returns::<u128>()
.invoke();
result
}
// Different contract, using this code hash for the delegate call.
#[ink(storage)]
pub struct Callee {
value: u128,
}
#[ink(message)]
pub fn get_value(&self) -> u128 {
self.value
}
In this example we are executing the Callee code in the context of the Caller contract. This means we'll be using the storage values of the Caller contract.
Running this code we expect the delegate call to return value as it was stored in the Caller contract. However, due to the reported bug a different value is returned (for the case of uints it is 256 times the expected value).
Impact
After conducting an analysis of the on-chain deployments of ink! contracts on Astar, Shiden, Aleph Zero, Amplitude and Pendulum, we have found that no contracts on those chains have been affected by the issue.
This bug was related to the mechanics around decoding a call's return buffer, which was changed as part of https://github.com/paritytech/ink/pull/1450. Since this feature was only released in ink! 4.0.0 no previous versions are affected.
Mitigations
If you have an ink! 4.x series contract, please update it to the 4.2.1 patch release that we just published.
Credits
Thank you Facundo Lerena from CoinFabrik for reporting this problem in a well-structured and responsible way.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | ink | ≥ 4.0.0&&< 4.2.1 | 4.2.1cargo update -p ink --precise 4.2.1 |
| 🦀crates.io | ink_env | ≥ 4.0.0&&< 4.2.1 | 4.2.1cargo update -p ink_env --precise 4.2.1 |
Affected Products
ink\!parityResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for ink, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update ink to 4.2.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2023-34449 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2023-34449 in your dependencies?
Find it across crates.io, including transitive dependencies.