Skip to content

fix(rust): disable unsafe cargo build by default to prevent ACE#2409

Closed
GHOryy5 wants to merge 2 commits intogoogle:mainfrom
GHOryy5:patch-1
Closed

fix(rust): disable unsafe cargo build by default to prevent ACE#2409
GHOryy5 wants to merge 2 commits intogoogle:mainfrom
GHOryy5:patch-1

Conversation

@GHOryy5
Copy link
Copy Markdown

@GHOryy5 GHOryy5 commented Dec 10, 2025

This PR mitigates a Critical Arbitrary Code Execution (ACE) vulnerability in the Rust source analysis pipeline.

The Vulnerability
Currently, rustBuildSource executes cargo build on the target repository. In the Rust ecosystem, cargo build executes build.rs scripts and procedural macros. If osv-scanner is run on an untrusted malicious repository, that repository can execute arbitrary code on the scanner's host.

@another-rex
Copy link
Copy Markdown
Collaborator

Thanks for the contribution!

Rust call analysis is not enabled by default, and has to be manually enabled, so I'm not sure adding an extra env makes sense.

It is also made clear that it's building the project to do call analysis, so it's up to the user to not run malicious build scripts.
https://google.github.io/osv-scanner/usage/scan-source#call-analysis-in-rust

Perhaps a change to the --help message would be more appropriate here?

E.g. update --call-analysis flag help text to describe how it should be called (with the language, the list of available languages, and perhaps a warning for languages that have automatic build scripts.)

another-rex added a commit that referenced this pull request Jan 21, 2026
This change updates the documentation and help output to clarify that
Rust call analysis runs build scripts. It adds a warning to the
documentation and enhances the help text to make this behavior more
explicit to users.

Closes #2409 

---
*PR created automatically by Jules for task
[7523658291025527036](https://jules.google.com/task/7523658291025527036)
started by @another-rex*

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Joey L <joeylauy@google.com>
Co-authored-by: Rex P <106129829+another-rex@users.noreply.github.com>
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.

2 participants