CVE-2026-24889
Rust vulnerability analysis and mitigation

Overview

CVE-2026-24889 is an integer overflow (wraparound) vulnerability in the soroban-sdk Rust SDK for Soroban smart contracts on the Stellar blockchain. It affects the Bytes::slice, Vec::slice, and Prng::gen_range (for u64) methods in soroban-sdk versions prior to 22.0.9, versions 23.0.0 through 23.5.0, and versions 25.0.0 through 25.0.1. The vulnerability was published on January 28, 2026, with patches released the same day. It carries a CVSS v3.1 base score of 5.3 (Medium) (GitHub Advisory).

Technical details

The root cause is CWE-190 (Integer Overflow or Wraparound): when soroban-sdk is compiled with overflow-checks = false (the default for Rust release builds), bare arithmetic operations (+1 / -1) used to convert range bounds in Bytes::slice, Vec::slice, and Prng::gen_range silently wrap at integer boundaries. For example, Bytes::slice(0..=u32::MAX) computes u32::MAX + 1 which wraps to 0, producing slice(0..0) and returning an empty result instead of the full range; similarly, Prng::gen_range((Bound::Excluded(u64::MAX), Bound::Unbounded)) wraps u64::MAX + 1 to 0, producing the full 0..=u64::MAX range instead of an empty/invalid one. Exploitation requires that a contract passes user-controlled or computed range bounds to the affected methods and has overflow-checks = false set (explicitly or by omitting the recommended configuration). The fix, implemented in PR #1703, replaces bare arithmetic with checked_add / checked_sub using an expect_optimized helper that traps via wasm32::unreachable() on Wasm and panics in tests (GitHub Advisory, Fix PR).

Impact

Successful exploitation can result in corrupted Soroban contract state due to silent data integrity violations: Bytes::slice and Vec::slice may operate on incorrect data ranges (e.g., returning empty slices or wrong subsets), and Prng::gen_range may generate random numbers from an unintended range, undermining contract logic that depends on bounded randomness. There is no confidentiality or availability impact; the primary risk is integrity compromise of on-chain contract state and logic. Contracts that rely on these methods for access control, financial calculations, or randomness-based decisions are most at risk (GitHub Advisory).

Exploitability

There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the time of disclosure (GitHub Advisory). The vulnerability is only exploitable in contracts that have overflow-checks = false, which is contrary to the best practice promoted by Stellar tooling and documentation; the majority of contracts are therefore expected to be unaffected. The EPSS score is approximately 0.015% (6th percentile), indicating a very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog, and no threat actor attribution is available.

Exploitation steps

  1. Identify a vulnerable contract: Locate a deployed Soroban contract built with soroban-sdk versions prior to 22.0.9, 23.5.1, or 25.0.2 that has overflow-checks = false in its release profile and passes user-controlled or computed values to Bytes::slice, Vec::slice, or Prng::gen_range.
  2. Craft boundary-value inputs: Prepare inputs that, when used as range bounds, trigger integer wraparound — for example, passing u32::MAX as an inclusive end bound to Bytes::slice or Vec::slice (causing u32::MAX + 1 to wrap to 0), or passing Bound::Excluded(u64::MAX) as a start bound to Prng::gen_range (causing u64::MAX + 1 to wrap to 0).
  3. Submit the crafted transaction: Invoke the vulnerable contract function with the crafted boundary-value inputs via a standard Stellar transaction.
  4. Observe incorrect behavior: The contract silently operates on a wrapped (incorrect) range — e.g., slice(0..=u32::MAX) returns an empty slice instead of the full data, or gen_range produces values from the full u64 range instead of the intended empty/invalid range — potentially corrupting contract state or bypassing logic that depends on correct range behavior (GitHub Advisory, Fix PR).

Mitigation and workarounds

Upgrade soroban-sdk to a patched version: 22.0.9 (for versions prior to 23.0.0), 23.5.1 (for 23.x versions), or 25.0.2 (for 25.x versions). If immediate patching is not possible, enable overflow-checks = true in the [profile.release] section of the contract workspace's Cargo.toml — this is the recommended best practice and the default generated by stellar contract init. As an additional workaround, contracts can validate range bounds before passing them to slice() or gen_range(): avoid passing Bound::Excluded(u32::MAX) or Bound::Included(u32::MAX) to Bytes::slice/Vec::slice, and avoid Bound::Excluded(u64::MAX) as a start bound or Bound::Excluded(0) as an end bound to Prng::gen_range (GitHub Advisory).

Community reactions

The fix was authored and merged by Stellar contributor leighmcculloch on January 28, 2026, with code review approvals from dmkozh and jayz22. The advisory notes that the best-practice tooling (stellar contract init) already encourages overflow-checks = true, and the Stellar team anticipated that the majority of deployed contracts would not be impacted. No significant external media coverage or notable community controversy was observed (Fix PR, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-53530HIGH8.7
  • Rust logoRust
  • ratex-parser
NoYesAug 21, 2026
CVE-2026-53531MEDIUM6.9
  • Rust logoRust
  • ratex-parser
NoYesAug 21, 2026
GHSA-mc9m-6fm9-pghcMEDIUM6.9
  • Python logoPython
  • zoo-kcl
NoYesAug 20, 2026
GHSA-jgvr-6x5w-hx5wMEDIUM6.9
  • Python logoPython
  • kcl-lib
NoYesAug 20, 2026
CVE-2026-54136MEDIUM5.1
  • Rust logoRust
  • windmill-api
NoYesAug 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management