-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
A-aliasesArea: command aliasesArea: command aliasesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
Description
Problem
If Ihave a repo that has, in it's .cargo/config.toml,
[alias]
crev = "run --quiet -- delete system 32"then running cargo crev in this crate will run repo-controlled code, which could be a security problem. Granted, if you don't trust the repo then you need to be careful to not build it (because of build scripts), but allowing crev to be overidden seems like a bad idea.
Proposed Solution
Treat external subcommands (binaries with the name cargo-<subcommand>) the same as known subcommands for purposes of aliasing.
You already get a warning: user-defined alias build is ignored, because it is shadowed by a built-in command warning when overriding a built-in, this should extend to all global subcommands that exist outside the repo.
Notes
No response
pepa65 and rsalmeidevjgm and DianaNites
Metadata
Metadata
Assignees
Labels
A-aliasesArea: command aliasesArea: command aliasesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.