Slopsquatting: Wenn KI-Assistenten Pakete erfinden, die es nicht gibt
KI-Coding-Assistenten empfehlen bisweilen npm-Pakete, die nie existiert haben, mit plausibel klingenden Namen und perfekt formatierten Installationsbefehlen. Angreifer koennen solche Namen registrieren und die Pakete mit Schadcode fuellen, ein Risiko besonders bei frischen Releases.

Bittet man einen Coding-Assistenten, ein Nischen-Dateiformat zu parsen, schlägt dieser manchmal vor, npm install für ein Paket auszuführen, das nie existiert hat. Es klingt plausibel, der Name passt zur Aufgabe, und der Installationsbefehl ist perfekt formatiert. Ist der Name nicht registriert, schlägt die Installation fehl und man zieht weiter. Hat jemand ihn letzte Woche registriert, funktioniert die Installation.
Diesen zweiten Fall hat man angefangen, Slopsquatting zu nennen, einen Verwandten des Typosquatting, bei dem der Tippfehler von einem Modell stammt und nicht von einem müden Tipper. Ich würde es auf Ihre Liste der Probleme setzen, die Sie sich ansehen sollten, bevor es Schlagzeilen macht, denn der Aufwand für die Prüfung beträgt eine Stunde, und die Kosten des Ignorierens bestehen darin, dass fremder Code in Ihrem Build läuft.
Was die Studie nicht zeigt, ist, dass Angreifer dies im großen Stil ausnutzen, und ich führe keinen Fall an, in dem sie es getan hätten. Ich behandle es als dokumentierte Schwachstelle mit einem offensichtlichen Nutzen für einen Angreifer, und genau solche Dinge neigen dazu, irgendwann eingesetzt zu werden. Das ist meine Einschätzung, gewichten Sie sie entsprechend.
Der weitere Hintergrund ist real. Der Verletzungsbericht von Verizon 2026 besagt, dass die Ausnutzung von Schwachstellen inzwischen der häufigste Einstiegsweg in Organisationen ist mit 31 Prozent aller Sicherheitsverletzungen und dass Vorfälle mit Beteiligung eines Drittanbieters 48 Prozent der Gesamtzahl erreichten (Verizon). Ihre Abhängigkeiten sind ein Drittanbieter, den Sie selbst installiert haben.
Es hilft, die Arten zu trennen, wie ein Paket Ihnen schaden kann, denn die Abwehrmaßnahmen unterscheiden sich.
Die erste ist der soeben beschriebene erfundene Name. Ein Paket, das nie auf Ihrer Liste hätte stehen dürfen, steht jetzt darauf, weil jemand einen Befehl ungeprüft übernommen hat.
Die zweite ist ein echtes, vertrauenswürdiges Paket, das eine schlechte Version ausliefert. Das Konto eines Maintainers wird übernommen oder ein Release-Prozess missbraucht, und eine neue Version erscheint, die etwas Bösartiges enthält. Das ist die vertrautere Variante, und der Schaden entsteht im Zeitfenster zwischen Veröffentlichung und Entdeckung.
Die dritte ist leiser. Ihr Build löst Abhängigkeiten locker auf, sodass das, was Sie am Montag testen, nicht das ist, was Sie am Freitag ausliefern. Ein Versionsbereich, eine fehlende Lockfile oder latest in einem Manifest lässt eine ungeprüfte Veröffentlichung in die Produktion, ohne dass jemand entschieden hat, dass sie dorthin gehört.
Für das erste Problem und einen Teil des zweiten habe ich ein kleines Skript geschrieben. Es liest eine package.json und fragt für jede Abhängigkeit die öffentliche npm-Registry ab, wann das Paket erstmals veröffentlicht wurde, wie viele Maintainer es hat und wie viele Downloads es letzte Woche hatte. Es markiert alles, was in der Registry fehlt, jünger als 90 Tage ist, weniger als 500 Downloads pro Woche hat oder nur einen Maintainer besitzt.
Ich habe es mit einer Testdatei ausgeführt, die Express, eines meiner eigenen Pakete und einen erfundenen Namen enthielt. Dies ist die tatsächliche Ausgabe:
ok express first published 2010-12-29 (5817 days), 198912592 downloads last week, 5 maintainer(s) CHECK gatewayproof first published 2026-09-15 (78 days), 12 downloads last week, 1 maintainer(s) <- younger than 90 days, under 500 downloads last week, single maintainer MISSING zzz-not-a-real-pkg-48213 (not on the registry: a typo, a private name, or a hallucination) Enter fullscreen mode Exit fullscreen mode Beachten Sie, dass es gatewayproof markiert hat, das meines ist, ein kleines Werkzeug mit einem Maintainer, das auf npm noch keine 90 Tage alt ist. Das ist das richtige Verhalten. Die Markierungen sind Aufforderungen für einen Menschen zum Hinschauen, keine Urteile.
Ein unbekanntes junges Paket mit einem Maintainer und einem Dutzend Downloads kann in Ordnung sein, und Sie sollten trotzdem sagen können, warum Sie es gewählt haben. Das Skript besteht aus etwa vierzig Zeilen einfachem Node und benötigt keine Installation, sodass man es leicht lesen kann, bevor man es ausführt.
Dasselbe können Sie von Hand für jedes Paket tun. npm view some-package time.created maintainers gibt das Erstveröffentlichungsdatum und die Personen aus, die veröffentlichen dürfen, und https://api.npmjs.org/downloads/point/last-week/some-package liefert die wöchentlichen Downloads. Sehen Sie sich auch den Repository-Link an und prüfen Sie, ob das Repository existiert, eine Historie hat und zum Paket passt.
Für das dritte Problem verraten Ihnen zwei schnelle Befehle viel. grep -nE '"(\*|latest)"' package.json findet Abhängigkeiten ohne jegliche Versionseinschränkung. Und suchen Sie in Ihrer CI-Konfiguration nach npm install. In einer Pipeline wollen Sie fast immer npm ci, das exakt das installiert, was die Lockfile vorgibt, und fehlschlägt, wenn Lockfile und Manifest nicht übereinstimmen. Stellen Sie sicher, dass die Lockfile eingecheckt ist.
Verzögern Sie neue Veröffentlichungen. Die pnpm-Dokumentation merkt an, dass bösartige Versionen meist schnell aus der Registry entfernt werden, in den meisten Fällen innerhalb einer Stunde, und bietet eine Einstellung, die die Installation von Versionen unterhalb eines bestimmten Alters verweigert. Der Standardwert sind 1.440 Minuten, also ein Tag, und Sie können ihn erhöhen, zum Beispiel auf 10.080 für eine Woche (pnpm docs):
# pnpm-workspace.yaml minimumReleaseAge: 4320 # three days, in minutes minimumReleaseAgeStrict: true Enter fullscreen mode Exit fullscreen mode Dependabot von GitHub verfolgt dieselbe Idee. Seit einer Änderung im Juli 2026 wartet es standardmäßig drei Tage, bevor es einen Versionierungs-Pull-Request für eine neue Veröffentlichung öffnet, Sicherheitsupdates werden niemals verzögert, und Sie können die Frist pro Abhängigkeit oder nach Art des Updates verlängern (GitHub docs):
#.github/dependabot.yml version: 2 updates: - package-ecosystem: "npm" directory: "/" schedule: interval: "weekly" cooldown: default-days: 7 semver-major-days: 30 Enter fullscreen mode Exit fullscreen mode Prüfen Sie jede neue Abhängigkeit, nicht nur Upgrades. Fügen Sie Ihrer Pull-Request-Vorlage eine Zeile hinzu, die lautet: „Falls dies ein Paket hinzufügt: Warum genau dieses, und was wurde geprüft?“ Eine Person, die die Antwort eintippen muss, öffnet in der Regel zuerst die Registry-Seite. Diese eine Gewohnheit würde die meisten erfundenen Namen verhindern.
Schränken Sie ein, was KI-Werkzeuge dürfen. Ein Coding-Agent, der unbeaufsichtigt npm install ausführen kann, ist ein sehr effizienter Weg, ein halluziniertes Paket zu installieren. Lassen Sie Assistenten Änderungen an der package.json vorschlagen und eine Person oder eine geprüfte Pipeline die Installation ausführen. Das ist dasselbe Berechtigungsdenken wie in meinem Artikel über das sichere Rollout von Agenten: das Modell darf fragen, und das System entscheidet.
Für Installationen in Umgebungen, die Geheimnisse verwalten, erwägen Sie npm ci --ignore-scripts, das die Installationsskripte überspringt, die Pakete mitliefern können, und führen Sie danach nur die Build-Schritte aus, denen Sie vertrauen. Manche Pakete brauchen ihre Skripte, also testen Sie es, bevor Sie es zur Regel machen.
Ein Sechser-Team bittet einen Assistenten um Hilfe bei der Erzeugung von Rechnungen als PDFs aus einem Nischen-Export eines Buchhaltungssystems. Der Assistent schlägt acct-export-pdf vor, und der Entwickler installiert es ohne zweiten Blick. Beim Ausführen der Prüfung auf diese package.json am nächsten Tag meldet das Skript, dass das Paket vor neun Tagen erstmals veröffentlicht wurde, letzte Woche 31 Downloads hatte und einen Maintainer besitzt.
Ein Blick in das Repository zeigt ein von einem anderen Projekt kopiertes README und ein postinstall-Skript, das einen Netzwerkaufruf tätigt. Das ist ein erfundenes Beispiel für den Zweck der Prüfung, aber die Form ist realistisch. Das Team entfernt das Paket, findet die Bibliothek, die alle für diesen Zweck verwenden, und ergänzt die Pull-Request-Frage, sodass die nächste Person die Wahl begründen muss.
Der Aufwand für das Team betrug zehn Minuten. Die Kosten eines Pakets mit einem postinstall-Skript, das auf einem Entwickler-Laptop mit Cloud-Zugangsdaten läuft, sind ein längeres Gespräch.
Wenn Sie Hilfe dabei wünschen, das Skript auf Python-, Go- oder Rust-Registries anzupassen oder zu prüfen, wie Ihre CI Abhängigkeiten auflöst, sehe ich mir das gern an.
Michael, ArkNet Digital ( https://www.arknet.digital )
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Ask a coding assistant to parse a niche file format and it will sometimes tell you to run npm install on a package that has never existed. It sounds plausible, the name fits the job, and the install command is formatted perfectly. If the name is unregistered, the install fails and you move on. If somebody registered it last week, the install succeeds.
That second case is what people have started calling slopsquatting, a cousin of typosquatting where the misspelling comes from a model and not a tired typist. I'd put it on your list of problems to look at before it becomes a headline, because the cost of checking is an hour and the cost of ignoring it is somebody else's code running in your build.
What the paper doesn't show is that attackers are exploiting this at scale, and I'm not citing a case where they did. I'm treating it as a documented weakness with an obvious payoff for an attacker, which is the sort of thing that tends to get used. That's my judgment, so weigh it accordingly.
The wider backdrop is real. Verizon's 2026 breach report says vulnerability exploitation is now the leading way into organizations at 31 percent of breaches, and that breaches involving a third party reached 48 percent of the total ( Verizon ). Your dependencies are a third party you installed yourself.
It helps to separate the ways a package can hurt you, because the defences differ.
The first is the invented name just described. A package that never should have been on your list is now on it, because someone pasted a command without checking.
The second is a real, trusted package that ships a bad version. A maintainer's account is taken over, or a release process is abused, and a new version appears containing something nasty. This is the more familiar kind, and the damage happens in the window between publication and discovery.
The third is quieter. Your build resolves dependencies loosely, so what you test on Monday is not what you deploy on Friday. A version range, a missing lockfile, or latest in a manifest lets an unreviewed release into production without anyone deciding it should.
I wrote a small script for the first problem and for part of the second. It reads a package.json, and for each dependency it asks the public npm registry when the package was first published, how many maintainers it has and how many downloads it had last week. It flags anything missing from the registry, younger than 90 days, with fewer than 500 weekly downloads, or with a single maintainer.
I ran it on a test file containing Express, one of my own packages and a name I made up. This is the actual output:
ok express first published 2010-12-29 (5817 days), 198912592 downloads last week, 5 maintainer(s) CHECK gatewayproof first published 2026-09-15 (78 days), 12 downloads last week, 1 maintainer(s) <- younger than 90 days, under 500 downloads last week, single maintainer MISSING zzz-not-a-real-pkg-48213 (not on the registry: a typo, a private name, or a hallucination) Enter fullscreen mode Exit fullscreen mode Notice that it flagged gatewayproof, which is mine, a small tool with one maintainer that is under 90 days old on npm. That's the right behavior. The flags are prompts for a human to look, not verdicts.
An unknown young package with one maintainer and a dozen downloads may be fine, and you should still be able to say why you chose it. The script is about forty lines of plain Node and needs no install, so it's easy to read before you run it.
You can do the same by hand for any package. npm view some-package time.created maintainers prints the first publication date and who can publish, and https://api.npmjs.org/downloads/point/last-week/some-package returns weekly downloads. Look at the repository link as well, and check that the repository exists, has history and matches the package.
For the third problem, two quick commands tell you a lot. grep -nE '"(\*|latest)"' package.json finds dependencies with no version constraint at all. And in your CI configuration, look for npm install. In a pipeline you almost always want npm ci, which installs exactly what the lockfile says and fails if the lockfile and manifest disagree. Confirm the lockfile is committed.
Delay new releases. The pnpm documentation notes that malicious versions are usually found and removed from the registry quickly, in most cases within an hour, and offers a setting that refuses to install versions younger than a given age. The default is 1,440 minutes, one day, and you can raise it, for example to 10,080 for a week ( pnpm docs ):
# pnpm-workspace.yaml minimumReleaseAge: 4320 # three days, in minutes minimumReleaseAgeStrict: true Enter fullscreen mode Exit fullscreen mode GitHub's Dependabot has the same idea. Since a July 2026 change it waits three days by default before opening a version-update pull request for a new release, never delaying security updates, and you can lengthen it per dependency or by update type ( GitHub docs ):
#.github/dependabot.yml version: 2 updates: - package-ecosystem: "npm" directory: "/" schedule: interval: "weekly" cooldown: default-days: 7 semver-major-days: 30 Enter fullscreen mode Exit fullscreen mode Review every new dependency, not only upgrades. Add a line to your pull request template that says "If this adds a package, why this one, and what did you check?" A person who has to type the answer will usually open the registry page first. That one habit would stop most invented names.
Constrain what AI tools may do. A coding agent that can run npm install unattended is a very efficient way to acquire a hallucinated package. Let assistants propose changes to package.json, and let a person or a reviewed pipeline run the install. This is the same permission thinking as in my piece on rolling out agents safely: the model can ask, and the system decides.
For installs in environments that handle secrets, consider npm ci --ignore-scripts, which skips the install-time scripts packages can ship, and then run only the build steps you trust. Some packages need their scripts, so test before you make it a rule.
A six-person team asks an assistant for help generating invoices as PDFs from a niche accounting export. The assistant suggests acct-export-pdf and the developer installs it without a second look. Running the check on that package.json the next day, the script prints that it was first published nine days ago, with 31 downloads last week and one maintainer. A look at the repository finds a README copied from another project and a postinstall script that makes a network call. That's an invented example of what the check is for, and the shape is realistic. The team removes the package, finds the real library everybody uses for this, and adds the pull request question so the next person has to justify the choice.
The cost to the team was ten minutes. The cost of a package with a postinstall script running on a developer laptop that holds cloud credentials is a longer conversation.
If you'd like help adapting the script to Python, Go or Rust registries, or reviewing how your CI resolves dependencies, I'm happy to take a look.
Michael, ArkNet Digital ( https://www.arknet.digital )