Skip to content

Bump remove_dir_all - #3244

Merged
rbtcollins merged 1 commit into
rust-lang:masterfrom
rbtcollins:remove-dir-all
Feb 28, 2023
Merged

rbtcollins merged 1 commit into
rust-lang:masterfrom
rbtcollins:remove-dir-all

Conversation

@rbtcollins

Copy link
Copy Markdown
Contributor

While this fixes a TOCTOU bug in the dependency, rustup is run either as an unprivileged process, or as a privileged process operating on a file tree that the privileged user owns; it is not a setuid binary and that mitigates much of the vulnerability: a deliberately misconfigured sudoers or similar would be required. Thus this hardens rustup against misconfiguration, but does not close an active vulnerability in how rustup is designed to be used.

@0xPoe

0xPoe commented Feb 27, 2023

Copy link
Copy Markdown
Member

While this fixes a TOCTOU bug in the dependency,

Sorry, I am not sure I get the point.

Do you mean rustup will delete some files that users do not expect to delete? How will the parallel feature help this?

@rbtcollins

Copy link
Copy Markdown
Contributor Author

Current master uses a version of remove_dir_all that has parallel enabled by default. This PR just keeps the current feature. The parallel deletion feature helps with the performance of removing toolchains - which have 10's of thousands of files.

The reason for the upgrade is a new release - as usual - but also there is a CVE in older versions that means we should upgrade now rather than later.

@0xPoe 0xPoe left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the description in the changelog for this CVE. Thanks!

While this fixes a TOCTOU bug in the dependency, rustup is run either as
an unprivileged process, or as a privileged process operating on a file
tree that the privileged user owns; it is not a setuid binary and
that mitigates much of the vulnerability: a deliberately misconfigured
sudoers or similar would be required. Thus this hardens rustup against
misconfiguration, but does not close an active vulnerability in how
rustup is designed to be used.
@rbtcollins
rbtcollins merged commit f80e290 into rust-lang:master Feb 28, 2023
@rbtcollins
rbtcollins deleted the remove-dir-all branch February 28, 2023 12:38
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