[RRFC] Verify publisher identity for reused repository URLs
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
Direzione di ricerca
Nell’issue non sono identificati file di implementazione, test o punti di ingresso; inizia esaminando il cross-check desiderato del publisher, il flusso di provenance, le notifiche, la gestione delle controversie e la designazione dei fork. Il lavoro sarebbe considerato completato con un design concordato e un piano di implementazione per questi comportamenti di sicurezza della pubblicazione, poiché i riferimenti sono elencati come n/a.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Motivation ("The Why")
Publishing to npm today allows anyone to set the homepage and repository fields in their package metadata without any verification. This gap makes it trivial for a malicious actor to impersonate popular packages by reusing their metadata, tricking users into installing modified or harmful code under a familiar name.
Example
Consider these two packages:
- fs-extra (the legitimate package):
https://npmjs.org/package/fs-extra
repository: https://github.com/jprichardson/node-fs-extra
latest version: 11.3.0 - fs-extra2 (imposter):
https://npmjs.com/package/fs-extra2
repository: https://github.com/jprichardson/node-fs-extra
latest version: 1.0.1
At a glance, the metadata matches exactly—but the version (1.0.1) in the imposter does not correspond to any tagged release in the real fs-extra GitHub repo. A user who installs fs-extra2 may assume they’re getting the genuine library, whereas they’re actually pulling unverified code.
How
Current Behaviour
- No metadata verification
npm does not check that the maintainer/publisher of a package matches the owner of thehomepageorrepositoryURLs specified inpackage.json. - Unilateral package creation
Anyone can publish a new package whose metadata duplicates that of an existing package (aside from the package name). - No notification to original maintainers
The legitimate publisher has no way of knowing when someone else reuses their repo URL or homepage in a different package.
Desired Behaviour
- Metadata‑to‑publisher cross‑check
When publishing a package whoserepositoryorhomepageURL exactly matches that of a previously published package:- Verify that the npm publisher account matches the GitHub (or other VCS) repo owner.
- Provenance verification flow
If the publisher accounts don’t match:- Prompt the uploader to prove they have rights to those URLs (for example via GitHub’s provenance or an ownership token).
- Maintain transparency and safety
- Send an automated email to the original publisher(s) of the URL in question, informing them that another package is reusing their metadata.
- Allow the original publisher to confirm or dispute:
- If confirmed: proceed with the publish.
- If disputed or unconfirmed within a grace period: either block the publish or add a clear “⚠️ Unverified repository URL” label on the package’s npm page.
- Optional “fork” designation
- In cases where the author legitimately forks a project, allow a “fork” checkbox or CLI flag that marks the package as a fork of the original.
References
- n/a
- Lingua principale
- JavaScript
- Stelle
- 780
- Fork
- 266
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di npm/rfcs
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Issue simili
-
accessibility bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/quarto-cli#15440 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
crxjs/chrome-extension-tools#1261 ·
-
support
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
01 type: bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
conorbronsdon/avoid-ai-writing#559 ·
I maintainer di solito rispondono entro 1 giorno