Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. soroban-sdk-macros
  4. ›
  5. CVE-2026-26267

CVE-2026-26267: The rs-soroban-sdk #[contractimpl] macro calls inherent function instead of trait function when names collide

February 17, 2026 (updated February 19, 2026)

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:
impl MyContract {
fn value() { ... }
}
  • Through a trait
impl Trait for MyContract {
fn value() { ... }
}

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 named functions, without #[contractimpl] applied.

If the trait version contains important security checks, such as verifying the caller is authorized, that the inherent version does not, those checks are bypassed. Anyone interacting with the contract through its public interface will call the wrong function.

For example:

References

  • github.com/advisories/GHSA-4chv-4c6w-w254
  • github.com/stellar/rs-soroban-sdk
  • github.com/stellar/rs-soroban-sdk/commit/e92a3933e5f92dc09da3c740cf6a360d55709a2b
  • github.com/stellar/rs-soroban-sdk/pull/1729
  • github.com/stellar/rs-soroban-sdk/pull/1730
  • github.com/stellar/rs-soroban-sdk/pull/1731
  • github.com/stellar/rs-soroban-sdk/security/advisories/GHSA-4chv-4c6w-w254
  • nvd.nist.gov/vuln/detail/CVE-2026-26267

Code Behaviors & Features

Detect and mitigate CVE-2026-26267 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 22.0.10, all versions starting from 23.0.0 before 23.5.2, all versions starting from 25.0.0 before 25.1.1

Fixed versions

  • 25.1.1
  • 23.5.2
  • 22.0.10

Solution

Upgrade to versions 22.0.10, 23.5.2, 25.1.1 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-670: Always-Incorrect Control Flow Implementation

Source file

cargo/soroban-sdk-macros/CVE-2026-26267.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 25 Mar 2026 00:18:56 +0000.