CVE-2026-26267: Soroban sdk macros The Rs-soroban-sdk #[contractimpl] Macro Calls Vulnerability

HIGH
Advisory Identifier: GHSA-4chv-4c6w-w254
CVSS 7.5
CWE-670
Published
Advisory Summary

CVE-2026-26267 is a HIGH (CVSS 7.5) the rs-soroban-sdk #[contractimpl] macro calls vulnerability (CWE-670: Always-Incorrect Control Flow Implementation) affecting Soroban sdk macros libraries in the crates.io ecosystem. The issue involves the rs-soroban-sdk #[contractimpl] macro calls inherent function instead of trait function when names collide. Remediation is available by upgrading affected packages to version 25.1.1, 23.5.2, 22.0.10.

CVE-2026-26267 at a Glance

CVE Identifier CVE-2026-26267
GHSA Identifier GHSA-4chv-4c6w-w254
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-670: Always-Incorrect Control Flow Implementation
Affected Product Soroban sdk macros
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-26267

To remediate this vulnerability, upgrade all affected Soroban sdk macros dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

soroban-sdk-macros fixed: 25.1.1
Upgrade soroban-sdk-macros to 25.1.1
soroban-sdk-macros fixed: 23.5.2
Upgrade soroban-sdk-macros to 23.5.2
soroban-sdk-macros fixed: 22.0.10
Upgrade soroban-sdk-macros to 22.0.10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for soroban-sdk-macros

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-26267, inspect your project dependencies for Soroban sdk macros:

inspect dependencies for soroban-sdk-macros

Analyze the terminal output to locate any version of Soroban sdk macros in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 25.1.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-670: Always-Incorrect Control Flow Implementation, where the code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated. In Soroban sdk macros, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```rust impl MyContract { fn value() { ... } } ``` - Through a trait ```rust 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: ```rust #[contract] pub struct Contract; impl Contract { /// Inherent function — returns 1. /// Bug: The macro-generated WASM export is wired up to call this function. pub fn value() -> u32 { 1 } } pub trait Trait { fn value(env: Env) -> u32; } #[contractimpl] impl Trait for MyContract { /// Trait implementation — returns 2. /// Fix: The macro-generated WASM export should call this function. fn value() -> u32 { 2 } } ``` ### Patches The problem is patched in `soroban-sdk-macros` version **25.1.1**. The fix changes the generated call from `<Type>::func()` to `<Type as Trait>::func()` when processing trait implementations, ensuring Rust resolves to the trait associated function regardless of whether an inherent function with the same name exists. Users should upgrade to `soroban-sdk-macros` **>= 25.1.1** and recompile their contracts. ### Workarounds If upgrading is not immediately possible, contract developers can avoid the issue by ensuring that no inherent associated function on the contract type shares a name with any function in the trait implementation. Renaming or removing the conflicting inherent function eliminates the ambiguity and causes the macro-generated code to correctly resolve to the trait function.

CVE-2026-26267 Affected Soroban sdk macros Versions

3 component(s)
Fixed Versions:
25.1.123.5.222.0.10
Product / Package Ecosystem Affected Versions Fixed Version
soroban-sdk-macros
crates.io
≥ 25.0.0
< 25.1.1
25.1.1
soroban-sdk-macros
crates.io
≥ 23.0.0
< 23.5.2
23.5.2
soroban-sdk-macros
crates.io
< 22.0.10
22.0.10

References

Frequently Asked Questions

What is CVE-2026-26267?
CVE-2026-26267 is a security vulnerability in Soroban sdk macros involving The rs-soroban-sdk #[contractimpl] macro calls inherent function instead of trait function when names collide under CWE-670: Always-Incorrect Control Flow Implementation.
Which Soroban sdk macros versions are affected?
Affected versions include releases prior to 25.1.1, 23.5.2, 22.0.10 across affected packages: soroban-sdk-macros.
What version fixes CVE-2026-26267?
Upgrading to 25.1.1, 23.5.2, 22.0.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is soroban-sdk-macros affected?
Yes, soroban-sdk-macros is affected in releases prior to 25.1.1, 23.5.2, 22.0.10. Upgrade your dependency to 25.1.1, 23.5.2, 22.0.10 or later.
What is the CVSS score of CVE-2026-26267?
CVE-2026-26267 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-26267?
CVE-2026-26267 is classified under CWE-670: Always-Incorrect Control Flow Implementation (The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.).
How can I check crates.io dependencies for CVE-2026-26267?
Run the dependency tree command: 'inspect dependencies for soroban-sdk-macros'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4chv-4c6w-w254",
  "modified" : "2026-02-19T21:56:47Z",
  "published" : "2026-02-17T21:29:05Z",
  "aliases" : [ "CVE-2026-26267" ],
  "summary" : "The rs-soroban-sdk #[contractimpl] macro calls inherent function instead of trait function when names collide",
  "details" : "### Impact\n\nThe `#[contractimpl]` macro contains a bug in how it wires up function calls.\n\nIn Rust, you can define functions on a type in two ways:\n- Directly on the type as an inherent function:\n  ```rust\n  impl MyContract {\n      fn value() { ... }\n  }\n  ```\n- Through a trait\n  ```rust\n  impl Trait for MyContract {\n      fn value() { ... }\n  }\n  ```\n\nThese 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.\n\nThe 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.\n\nThis means the Wasm-exported entry point silently calls the wrong function when two conditions are met simultaneously:\n1. A `impl Trait for MyContract` block is defined with one or more functions, with `#[contractimpl]` applied.\n2. A `impl MyContract` block is defined with one or more identically named functions, without `#[contractimpl]` applied.\n\nIf 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.\n\nFor example:\n\n```rust\n#[contract]\npub struct Contract;\n\nimpl Contract {\n    /// Inherent function — returns 1.\n    /// Bug: The macro-generated WASM export is wired up to call this function.\n    pub fn value() -> u32 {\n        1\n    }\n}\n\npub trait Trait {\n    fn value(env: Env) -> u32;\n}\n\n#[contractimpl]\nimpl Trait for MyContract {\n    /// Trait implementation — returns 2.\n    /// Fix: The macro-generated WASM export should call this function.\n    fn value() -> u32 {\n        2\n    }\n}\n```\n\n### Patches\n\nThe problem is patched in `soroban-sdk-macros` version **25.1.1**. The fix changes the generated call from `<Type>::func()` to `<Type as Trait>::func()` when processing trait implementations, ensuring Rust resolves to the trait associated function regardless of whether an inherent function with the same name exists.\n\nUsers should upgrade to `soroban-sdk-macros` **>= 25.1.1** and recompile their contracts.\n\n### Workarounds\n\nIf upgrading is not immediately possible, contract developers can avoid the issue by ensuring that no inherent associated function on the contract type shares a name with any function in the trait implementation. Renaming or removing the conflicting inherent function eliminates the ambiguity and causes the macro-generated code to correctly resolve to the trait function.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "soroban-sdk-macros"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "25.0.0"
      }, {
        "fixed" : "25.1.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 25.1.0"
    }
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "soroban-sdk-macros"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "23.0.0"
      }, {
        "fixed" : "23.5.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 23.5.1"
    }
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "soroban-sdk-macros"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "22.0.10"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 22.0.9"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-soroban-sdk/security/advisories/GHSA-4chv-4c6w-w254"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-26267"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-soroban-sdk/pull/1729"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-soroban-sdk/pull/1730"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-soroban-sdk/pull/1731"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stellar/rs-soroban-sdk/commit/e92a3933e5f92dc09da3c740cf6a360d55709a2b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/stellar/rs-soroban-sdk"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-670" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-17T21:29:05Z",
    "nvd_published_at" : "2026-02-19T20:25:43Z"
  }
}