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
- npm publishes a dispute policy in npm Docs. Names held without meaningful content can be reclaimed in some circumstances, and npm explicitly discourages squatting. Scopes (
@org/name) let organisations sidestep competition for unscoped names. - PyPI follows PEP 541, which defines when a name counts as abandoned or invalid and describes a process for requesting transfer. Requests are handled by PyPI administrators and can take time.
- crates.io has its own usage policy discouraging squatting.
- Go largely avoids the problem because module paths are tied to domains and repository paths you control.
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
| Option | Benefit | Cost or risk |
|---|---|---|
| Publish everything under a scope or organisation namespace | No competition for names; clear ownership signal | Longer install names; existing unscoped names remain separate |
| Register names only when you publish real code | Fully consistent with registry policies | A name may be taken before you are ready |
| Reserve a small number of names with minimal placeholder releases | Protects names you will definitely use soon | May fall foul of anti-squatting rules if left empty; check policy first |
| Use dependency-confusion protection for internal names | Prevents public packages shadowing private ones | Requires 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.