Skip to content
Heist/ feed
Back to feed
High

rs-soroban-sdk #[contractimpl] macro calls inherent function instead of trait function when names collide

Type: advisorySources: OSV

soroban-sdk is a Rust SDK for Soroban contracts. Prior to versions 22.0.10, 23.5.2, and 25.1.1, the `#[contractimpl]` macro contains a bug in how it wires up function calls. `#[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: First, an `impl Trait for MyContract` block is defined with one or more functions, with `#[contractimpl]` applied. Second, an `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. The problem is patched in `soroban-sdk-macros` versions 22.0.10, 23.5.2, and 25.1.1. The fix changes the generated call from `::func()` to `::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` 22.0.10, 23.5.2, or 25.1.1 and recompile their contracts. If upgrading is not immediate

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-26267
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 03:40 UTC · Revision 1

Source evidence

rs-soroban-sdk #[contractimpl] macro calls inherent function instead of trait function when names collide

core-osv · Original source

Published 19 Feb 2026, 19:35 UTC

soroban-sdk is a Rust SDK for Soroban contracts. Prior to versions 22.0.10, 23.5.2, and 25.1.1, the `#[contractimpl]` macro contains a bug in how it wires up function calls. `#[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: First, an `impl Trait for MyContract` block is defined with one or more functions, with `#[contractimpl]` applied. Second, an `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. The problem is patched in `soroban-sdk-macros` versions 22.0.10, 23.5.2, and 25.1.1. The fix changes the generated call from `::func()` to `::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` 22.0.10, 23.5.2, or 25.1.1 and recompile their contracts. If upgrading is not immediate

osv:CVE-2026-26267
Complete source record
{
  "id": "1d97a31b932353f4559323eb7caf24f3a78783b902b61385bcb6dc33421f7bd9",
  "url": "https://osv.dev/vulnerability/CVE-2026-26267",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "rs-soroban-sdk #[contractimpl] macro calls inherent function instead of trait function when names collide",
    "summary": "soroban-sdk is a Rust SDK for Soroban contracts. Prior to versions 22.0.10, 23.5.2, and 25.1.1, the `#[contractimpl]` macro contains a bug in how it wires up function calls. `#[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: First, an `impl Trait for MyContract` block is defined with one or more functions, with `#[contractimpl]` applied. Second, an `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. The problem is patched in `soroban-sdk-macros` versions 22.0.10, 23.5.2, and 25.1.1. The fix changes the generated call from `::func()` to `::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` 22.0.10, 23.5.2, or 25.1.1 and recompile their contracts. If upgrading is not immediate",
    "evidence": "osv:CVE-2026-26267",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-26267",
      "aliases": [
        "CVE-2026-26267",
        "GHSA-4chv-4c6w-w254"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/stellar/rs-soroban-sdk",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "9a1b75b509a5053b676b09fdbd224fe8c5f2fcd5"
                },
                {
                  "introduced": "717595da8e7ca090a326116bfffb6aa4d4c74004"
                },
                {
                  "fixed": "347f71141ddf69ef1873527c94ac98e79215f125"
                },
                {
                  "introduced": "a3cefc1682d1d1ae2d894225c426af4cea7b752f"
                },
                {
                  "fixed": "94c2a3b3a5ded6b9cf9cef0c207bf8804f3eb294"
                },
                {
                  "fixed": "e92a3933e5f92dc09da3c740cf6a360d55709a2b"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:stellar:rs-soroban-sdk:*:*:*:*:*:rust:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "22.0.10"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:stellar:rs-soroban-sdk:*:*:*:*:*:rust:*:*",
                    "range": [
                      {
                        "introduced": "23.0.0"
                      },
                      {
                        "fixed": "23.5.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:stellar:rs-soroban-sdk:*:*:*:*:*:rust:*:*",
                    "range": [
                      {
                        "introduced": "25.0.0"
                      },
                      {
                        "fixed": "25.1.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "e92a3933e5f92dc09da3c740cf6a360d55709a2b"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v22.0.9",
            "v23.5.1",
            "v25.1.0",
            "v25.0.2",
            "v22.0.8",
            "v23.5.0",
            "v25.0.1",
            "v23.4.1",
            "v25.0.0",
            "v23.4.0",
            "v23.3.0",
            "v23.2.1",
            "v23.1.1",
            "v23.1.0",
            "v23.0.3",
            "v23.0.2",
            "v23.0.1",
            "v23.0.0",
            "v22.0.7",
            "v22.0.6",
            "v22.0.5",
            "v22.0.4",
            "v22.0.3",
            "v22.0.2",
            "v22.0.1",
            "v22.0.0",
            "v22.0.0-rc.3.2",
            "v22.0.0-rc.3.1",
            "v22.0.0-rc.3",
            "v22.0.0-rc.2.1",
            "v22.0.0-rc.2",
            "v22.0.0-rc.1.1",
            "v22.0.0-rc.1",
            "v21.7.1",
            "v21.7.0",
            "v21.6.0",
            "v21.5.2",
            "v21.5.1",
            "v21.5.0",
            "v21.4.0",
            "v21.3.0",
            "v21.2.0",
            "v21.1.1",
            "v21.1.0-rc.1",
            "v21.0.1-preview.3",
            "v21.0.1-preview.2",
            "v21.0.1-preview.1",
            "v20.5.0",
            "v20.4.0",
            "v20.3.2",
            "v20.3.1",
            "v20.3.0",
            "v20.2.0",
            "v20.1.0",
            "v20.0.3",
            "v20.0.2",
            "v20.0.1",
            "v20.0.0",
            "v20.0.0-rc2",
            "v20.0.0-rc1",
            "v0.9.2",
            "v0.9.1",
            "v0.9.0",
            "v0.8.4",
            "v0.8.3",
            "v0.8.2",
            "v0.8.1",
            "v0.8.0",
            "v0.7.0",
            "v0.6.0",
            "v0.5.0",
            "v0.4.3",
            "v0.4.2",
            "v0.4.1",
            "v0.4.0",
            "v0.3.2",
            "v0.3.1",
            "v0.3.0",
            "v0.2.0",
            "v0.2.1",
            "v0.1.0",
            "v0.0.6",
            "v0.0.4",
            "v0.0.3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-26267.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:49.606554870Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/26xxx/CVE-2026-26267.json",
        "https://github.com/stellar/rs-soroban-sdk/security/advisories/GHSA-4chv-4c6w-w254",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-26267",
        "https://github.com/stellar/rs-soroban-sdk/commit/e92a3933e5f92dc09da3c740cf6a360d55709a2b",
        "https://github.com/stellar/rs-soroban-sdk/pull/1729",
        "https://github.com/stellar/rs-soroban-sdk/pull/1730",
        "https://github.com/stellar/rs-soroban-sdk/pull/1731"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-670"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/26xxx/CVE-2026-26267.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-26267",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 517832,
  "published_at": "2026-02-19T19:35:40.539+00:00"
}