From ed025cc098c246c2f0a006eaa2b1325bf48f6dac Mon Sep 17 00:00:00 2001 From: LemonJ <1632798336@qq.com> Date: Thu, 28 May 2026 16:31:34 +0800 Subject: [PATCH] Add advisory for solana_rbpf invoke_function --- crates/solana_rbpf/RUSTSEC-0000-0000.md | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 crates/solana_rbpf/RUSTSEC-0000-0000.md diff --git a/crates/solana_rbpf/RUSTSEC-0000-0000.md b/crates/solana_rbpf/RUSTSEC-0000-0000.md new file mode 100644 index 000000000..9b36899d8 --- /dev/null +++ b/crates/solana_rbpf/RUSTSEC-0000-0000.md @@ -0,0 +1,43 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "solana_rbpf" +date = "2026-05-28" +url = "https://github.com/solana-labs/rbpf" +references = [ + "https://github.com/anza-xyz/sbpf/pull/151", + "https://crates.io/crates/solana-sbpf", +] +informational = "unsound" +categories = ["memory-corruption"] +keywords = ["soundness", "pointer-arithmetic", "out-of-bounds"] + +[affected.functions] +"solana_rbpf::vm::EbpfVm::invoke_function" = [">= 0.8.0, <= 0.8.5"] + +[versions] +patched = [] +unaffected = ["< 0.8.0"] +``` + +# `EbpfVm::invoke_function` performs out-of-bounds pointer arithmetic + +Affected versions of `solana_rbpf` expose the safe method +`EbpfVm::invoke_function`. This method computes an obfuscated VM pointer by +casting `self` to `*mut u64` and applying a randomized offset derived from +`get_runtime_environment_key()`. + +The resulting pointer arithmetic is performed with `ptr::offset`, which +requires the computed pointer to remain within the same allocation. In practice, +the randomized offset can move the pointer far outside the allocation +containing the `EbpfVm`, causing undefined behavior before the supplied builtin +function is invoked. + +## Unmaintained + +The upstream `solana_rbpf` repository is archived, and no patched version of +this crate is currently available. + +Users should migrate to the maintained [`solana-sbpf`](https://crates.io/crates/solana-sbpf) +crate. The issue has been fixed there in +[`anza-xyz/sbpf#151`](https://github.com/anza-xyz/sbpf/pull/151).