BlogSecurity
Slopsquatting: when your AI assistant installs malware.
AI coding assistants suggest software packages that do not exist. Attackers have noticed, and they are registering the names.
By Elvis Chege5 minute read
A new way in
Almost every modern application is mostly other people's code. A single npm install or pip install pulls in dozens of packages, each written by someone you have never met. For years the risk was typosquatting: an attacker publishes reqeusts and waits for someone to mistype requests.
AI assistants have opened a new door. Ask one to write code and it will often import a package that sounds right but does not exist. In a study of 16 code-generating language models across 576,000 code samples, researchers found that about one in five of the packages the models recommended did not exist (Spracklen and colleagues, "We Have a Package for You!", 2024).
A name that does not exist is a name anyone can register. If an attacker publishes a malicious package under a name the models keep inventing, the next developer who trusts the suggestion installs it. That is slopsquatting.
Why it matters here
Teams across East Africa are shipping faster than ever, often small teams leaning on AI to keep up. That is a good thing. But a bank, a SACCO or a government system that installs one poisoned package can leak credentials or customer data. Install scripts run with the developer's permissions, on the developer's machine, before any review happens.
Five things to do about it
- Check that a package is real before you install it. Look at who publishes it and when it was first released. A package that appeared last week with no history is a warning sign.
- Pin everything. Commit lockfiles and install from them in CI, so a build never quietly picks up something new.
- Put a gate in front of the registry. With a private registry or proxy and an allow-list, every new dependency is one a person approved.
- Scan packages when they're installed. By the time CI runs, an install script has already run on someone's laptop. This is the idea behind Doria, which won the ITWeb Security Summit Hackathon 2026: it stands in for the package manager and parses each package's code before it touches the disk.
- Treat AI suggestions like advice from a new colleague: often right, and reviewed like any other code before it ships.
Slopsquatting is one of several ways AI tools open new doors into a business. We test for the others too: see AI cybersecurity in Kenya.