Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crates/grep-cli: add advisory for arbitrary binary execution on Windows #939

Merged
merged 3 commits into from
Jun 14, 2021

Conversation

BurntSushi
Copy link
Contributor

@Shnatsel
Copy link
Member

Thanks for the report!

If you use grep-cli's CommandReader with a std::process::Command value on Windows, then it is recommended to either construct the Command with an absolute binary name, or use grep-cli's new resolve_binary helper function.

To clarify, is the old function with the problematic behavior still accessible through the public API?

@CodesInChaos
Copy link

You forgot to fill in the title

> # RustSec Advisory Template - Advisory Title Goes Here

Instead of dancing around it, we just say it: the main issue is that
std::process::Command will resolve relative binary names with respect to
the CWD first, because it just uses the Windows API for this.

More specifically, we call out the two particular mitigations that are
now in place.
@BurntSushi
Copy link
Contributor Author

@CodesInChaos Thanks, fixed!

@Shnatsel I pushed an update. Does it answer your question?

@Shnatsel
Copy link
Member

It does. Thanks!

@Shnatsel Shnatsel merged commit ec6dbf0 into rustsec:main Jun 14, 2021
@CodesInChaos
Copy link

btw is there a github issue for the underlying std::process::command pitfall?

@BurntSushi
Copy link
Contributor Author

BurntSushi commented Jun 15, 2021

@CodesInChaos No, but there should be. (At least, I don't think there's one.)

@BurntSushi BurntSushi deleted the ag/cve-2021-3013 branch June 15, 2021 11:31
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