rust-lang / rust-lang/cargo

Help catch internal-crate squatting attacks when adding a dependency

Open
#10,656 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request Command-add S-needs-design
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Problem

Say a company has an internal registry and with an internal crate company-utils. If an attacker knows this and creates a malicious crate in crates.io with that name, people will pick it up when running cargo add and forgetting the --registry flag

Proposed Solution

Warn the user when a new registry dependency is added without --registry and the dependency name exists in one of the configured registries.Se

Notes

See also https://github.com/killercup/cargo-edit/issues/451

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed behavior in this issue and the related cargo-edit issue 451, since no implementation files or tests are identified. Done means warning when a dependency name exists in a configured registry but is added without the --registry flag.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, devtools, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.