High, CVSS 7.5crates.ioPublished
The rs-soroban-sdk #[contractimpl] macro calls inherent function instead of trait function when names collide
CVE-2026-26267 · GHSA-4chv-4c6w-w254
- Affected
- crates.io soroban-sdk-macros >= 25.0.0, <= 25.1.0; >= 23.0.0, <= 23.5.1; <= 22.0.9
- Fixed in
- 25.1.122.0.1023.5.2· Vendor fix available
- Issue
- Impact The #[contractimpl] macro contains a bug in how it wires up function calls. In Rust, you can define functions on a type in two ways: - Directly on the type as an inherent function: - Through a trait These are two separate functions that happen to share the same name. Rust has rules for which one gets called. When you write MyContract::value(), Rust always picks the one defined directly on the type, not the trait version. The bug is that #[contractimpl] generates code that uses MyContract::value() style calls even when it's processing the trait version. This means if an inherent function is also defined with the same name, the inherent function gets called instead of the trait function. This means the Wasm-exported entry point silently calls the wrong function when two conditions are met simultaneously: 1. A impl Trait for MyContract block is defined with one or more functions, with #[contractimpl] applied. 2. A impl MyContract block is defined with one or more identically…
Recommended action: Upgrade to 25.1.1, 23.5.2 or 22.0.10 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.