CVE-2026-26267: Soroban sdk macros The Rs-soroban-sdk #[contractimpl] Macro Calls Vulnerability
HIGHCVE-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
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).
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.
Upgrade soroban-sdk-macros to 25.1.1
Upgrade soroban-sdk-macros to 23.5.2
Upgrade soroban-sdk-macros to 22.0.10
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
CVE-2026-26267 Affected Soroban sdk macros Versions
3 component(s)| 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?
Which Soroban sdk macros versions are affected?
What version fixes CVE-2026-26267?
Is soroban-sdk-macros affected?
What is the CVSS score of CVE-2026-26267?
What CWE is associated with CVE-2026-26267?
How can I check crates.io dependencies for CVE-2026-26267?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}