Skip to content

Add advisory for solana_rbpf: OOB pointer arithmetic in invoke_function#2921

Merged
djc merged 1 commit into
rustsec:mainfrom
DiuDiu777:solana-rbpf-invoke-function-advisory
Jun 29, 2026
Merged

Add advisory for solana_rbpf: OOB pointer arithmetic in invoke_function#2921
djc merged 1 commit into
rustsec:mainfrom
DiuDiu777:solana-rbpf-invoke-function-advisory

Conversation

@DiuDiu777

@DiuDiu777 DiuDiu777 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Affected crate(s)

  • solana_rbpf (362,603 recent downloads per crates.io; 4,761,947 total downloads)

Links to upstream issue(s) or PR(s)

The upstream repository is archived, so I cannot report this through the normal upstream issue tracker.

Severity

Informational soundness issue. Safe Rust code can construct an EbpfVm and call the safe method EbpfVm::invoke_function, which performs out-of-bounds pointer arithmetic internally.

The affected implementation casts self to *mut u64 and applies a randomized offset from get_runtime_environment_key() using ptr::offset. This can move the pointer outside the allocation containing the EbpfVm, causing undefined behavior before the supplied builtin function is invoked. Miri reports an in-bounds pointer arithmetic violation. No unsafe code is required from the caller.

Checklist

  • Advisory filename(s) starts with RUSTSEC-0000-0000 as the ID
  • date field is set to the public disclosure date
  • Contains a concise and descriptive title after advisory metadata
  • Asked maintainer(s) if publishing an advisory is appropriate

@djc

djc commented Jun 1, 2026

Copy link
Copy Markdown
Member

@Lichtso do you think it makes sense to publish this, with a note attached to clarify that this crate is unmaintained?

@DiuDiu777

Copy link
Copy Markdown
Contributor Author

Hi, gentle ping on this advisory PR. Is there anything I can provide or update to help move the review forward? Thanks!

@djc

djc commented Jun 29, 2026

Copy link
Copy Markdown
Member

I reached out to someone privately, let's see if that helps.

@nagisa

nagisa commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

It should be fine to land this. The issue is fixed in solana-sbpf (anza-xyz/sbpf#151) which is the maintained incarnation of the crate this report is against. Maybe if there's a way to nudge people towards a different crate, we should do that. Otherwise LGTM!

Comment thread crates/solana_rbpf/RUSTSEC-0000-0000.md Outdated
@djc

djc commented Jun 29, 2026

Copy link
Copy Markdown
Member

It should be fine to land this. The issue is fixed in solana-sbpf (anza-xyz/sbpf#151) which is the maintained incarnation of the crate this report is against. Maybe if there's a way to nudge people towards a different crate, we should do that. Otherwise LGTM!

Thanks!

@DiuDiu777 DiuDiu777 force-pushed the solana-rbpf-invoke-function-advisory branch from a69cde3 to ed025cc Compare June 29, 2026 14:31
@DiuDiu777

Copy link
Copy Markdown
Contributor Author

Done~ :)

@djc djc merged commit 77e44c2 into rustsec:main Jun 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants