Why are a package page's linked repository, stars and download count weak evidence of authenticity?
answer
- metadata is asserted, not verified
- stars live on the repo, not the artifact
- borrowed reputation from a real project
- popularity is inflatable and lagging
- only a signed source-to-artifact link counts
basics
~20 sMost registries never verify that the repository a package links to actually produced the published archive. Stars, README and badges belong to that repository, so an attacker can point at a popular project and borrow its reputation wholesale.
solid answer
~50 sRegistry metadata is asserted by the publisher at upload time, not verified. The repository URL, homepage, description and README all come from the archive the attacker uploaded, so declaring a well-known project's repository makes the package page render that project's README, badges and star count — this is starjacking, and it fools both a reviewer's eye and any tooling that ranks or auto-approves on popularity. Download counts are equally weak: they are inflatable, and once a squat starts landing they rise on their own. The evidence that counts is a verifiable link from artifact back to source: who owns the publishing name and whether ownership changed recently, whether the archive corresponds to the tagged commit, and a signed provenance attestation naming the source repository and commit — verified against the identity you expect, because a signature nobody checks against an expected signer proves nothing.
go deeper
Be ready to say that the repository link and README on a package page are supplied by whoever uploaded the package, and that popularity is not a check on identity.
Explain the mechanism precisely: metadata is self-asserted at publish time, stars belong to the forge repository rather than the artifact, and download counts are both inflatable and lagging.
Demonstrate the replacement: verify a provenance claim bound to the artifact's digest against an expected identity, check publisher ownership history, and compare the published archive with the tagged source before adopting.
Decide which signals your organisation is allowed to automate on. Ranking by popularity is fine; granting entry on it is not, and you should be able to explain that boundary to a team that wants faster approvals.
## Where package-page metadata comes from When a package is published, most of what you later see on its page is copied out of the uploaded archive's own manifest: description, homepage, repository URL, licence string, and often the README rendered inline. The registry stores what it was given. It generally does not fetch the repository, does not check that the repository contains this package, and does not check that the archive corresponds to anything in it. Badges are images fetched from URLs the publisher chose. Stars are not a registry concept at all — they live on the source forge, attached to the repository, and are displayed alongside the package only because the package claimed that repository. **Starjacking** is the exploitation of that gap: publish a package under a near-miss or invented name, but declare the repository of a genuinely popular project. The package page now shows a mature README, a long commit history one click away, a licence, and a star count in the thousands. Every human trust signal agrees. So does anything automated that scores packages by popularity — a ranking, a "trusted if widely used" rule, an internal dashboard that surfaces "reputable" candidates. Picture a crate published to a public crate index whose README, repository link and displayed stars are copied wholesale from a well-known crate. A reviewer opening the page sees the real project's documentation. The asset under attack here is unusual and worth naming in an interview: it is not customer data or availability, it is **the trust signals themselves**. Once reputation can be pointed at arbitrary artifacts, every downstream decision built on reputation degrades at once. ## Why download counts fail too - They can be inflated cheaply, since installs are unauthenticated fetches and mirrors and CI runs count. - They are a lagging indicator of the attack succeeding: a squat that is working produces exactly the rising curve people read as reassurance. - They measure the *name*, not the current *version*. A long-standing package whose maintainer account was taken over carries its whole historical count into its first malicious release. ## What is actually evidence Keep the three artifacts straight, because interviewers probe this exact confusion: - an **SBOM** tells you *what is inside* an artifact; - **provenance** tells you *how it came to be* — which source repository, which commit, which build system produced it; - a **signature** tells you *who vouches for it*. Starjacking is an attack on the "where did this come from" question, answered with unverified metadata. Provenance answers the same question with metadata that is cryptographically bound to the artifact's digest and signed, so the claim can be checked rather than believed. Concretely, in descending order of strength: 1. **A signed provenance attestation** whose subject digest matches the artifact you are about to install and whose predicate names the source repository and commit — checked against the identity you *expect* to see. Verifying only that some valid signature exists is a classic non-control: any attacker can sign their own artifact. 2. **Publisher identity and its history.** Who is allowed to publish under this name, how long have they held it, did ownership or the maintainer set change recently? 3. **Archive against source.** Does the published archive correspond to the tagged commit in the repository it claims? Any divergence is decisive. 4. **Corroboration from the project's own side.** Does the real project's documentation or release notes name this package and this publishing namespace? Reputation asserted by the *claimed* project's own channel is worth far more than reputation displayed next to the claim. ## The operating lesson Do not build automation on signals the registry does not verify. If an internal gate auto-approves packages above a popularity threshold, an attacker's cheapest move is to satisfy that threshold with borrowed metadata rather than to defeat any cryptography. Signals that a publisher can assert about themselves are useful for *sorting*; only signals bound to the artifact's digest are useful for *deciding*.
- Your internal gate auto-approves any package above a popularity threshold. What is wrong with that?It automates a signal the registry never verified, so the cheapest attack is to satisfy the threshold rather than defeat anything. A starjacked page can borrow a popular project's repository and stars, and download counts can be inflated or simply rise as the squat succeeds. Popularity is fine for ranking candidates for review; it must not be the thing that grants entry.
- What does verifying a provenance attestation add that reading the package page does not?Provenance is bound to the artifact's digest and signed, so the claim "this came from that repository at that commit, built by that system" can be checked rather than believed. The package page's repository field is a self-asserted string. The crucial part is verifying against the identity you expect: a signature you accept without checking who produced it adds no security at all, since an attacker can sign their own artifact.
- A long-established package suddenly ships malicious code. Which of these signals would have looked wrong?Almost none of the popularity ones — the star count, the download history and the README all belong to the package's genuine past and carry straight into the bad release. The signals that shift are publisher-side: a recent change of maintainers or publishing credentials, a release whose archive no longer corresponds to the tagged source, or provenance that names a different builder or repository than previous releases did.
A stall that hangs another restaurant's framed reviews on its own wall. The reviews are genuine — they are simply not about the food you are being served.
saying these in an interview costs you the question
- Treats star count as an authenticity check
- Assumes the registry verified the linked repository
- Says a valid signature alone proves the publisher is legitimate
- Confuses an SBOM's contents claim with an origin claim
- Trusts a high download count on a recently published name