Package Name Squatting: A Structured Look at the Policy Choices

Good package names are scarce. Registries are first come, first served, so names get claimed and then left empty, sometimes innocently, sometimes to resell, sometimes to block a competitor. This paper describes the problem, how registries currently handle it, and the options available to an organisation that wants to protect its own names without contributing to the problem.

The problem

Name squatting means registering a package name with no real intent to publish useful code under it. The effects are concrete. A project that has used a name for years on GitHub discovers the registry name is taken by an empty placeholder. Users search for the obvious name and find a stub, or worse, a lookalike carrying malicious code. Squatting is distinct from typosquatting, which imitates an existing name to trick people, but the two overlap: a squatted name close to a popular one can later be turned into an attack.

How registries handle it today

Policies change, and the wording matters, so read the current text of each registry's policy before acting rather than relying on summaries, including this one.

Options for an organisation

OptionBenefitCost or risk
Publish everything under a scope or organisation namespaceNo competition for names; clear ownership signalLonger install names; existing unscoped names remain separate
Register names only when you publish real codeFully consistent with registry policiesA name may be taken before you are ready
Reserve a small number of names with minimal placeholder releasesProtects names you will definitely use soonMay fall foul of anti-squatting rules if left empty; check policy first
Use dependency-confusion protection for internal namesPrevents public packages shadowing private onesRequires registry and client configuration

Recommendation

For most organisations: publish under a scope or namespace by default; register an unscoped name only alongside a real release; and never reserve names you have no concrete plan for. Protect internal names by configuring your package manager so that scoped internal packages resolve only from your private registry, for example:

# .npmrc
@yourco:registry=https://registry.example.internal/

If someone else holds a name you have a legitimate claim to, use the registry's documented dispute process rather than contacting the holder with offers to buy it; paid name transfers create exactly the incentives that encourage squatting in the first place. See our naming conventions essay and the typosquatting evidence summary for related reading.