DET-065 · human · confidence High
Internal Package Names on Public Registries
Watch public registries for packages that share names with internal ones.
Dependency confusion works when a public package takes an internal name with a higher version. Polling npm, PyPI and RubyGems for every internal package name, and alerting when one appears, catches both outside attackers and insiders setting the trap.
Run the check daily and on every new internal package. Also check build logs for resolutions from the public registry for internal names, which shows whether a collision was ever pulled in. An insider who knows the internal naming scheme is well placed to set this trap.
- Data sources
- Internal package inventoryPublic registry APIs
- Platforms
- SaaS
Logic
for name in internal_package_names:
r = GET https://registry.npmjs.org/<name> (or https://pypi.org/pypi/<name>/json)
if r.status == 200 and name not in reserved_by_us: alert(name, r.maintainers, r.latest_version)False positives
Coincidental name collisions with unrelated open source projects.