Phantom Dependency

Dependencies with commonly hallucinated or suspicious package names (slopsquatting)

warningSecurityphantom-dependency

Severity depends on context. Warning for names on the list of commonly hallucinated packages. Info for names that only match a suspicious pattern: one or two letters, a -js suffix, or a prefix like easy- or super-.

Why this matters

AI tools invent package names that sound right. Attackers register those names on npm and wait for someone to install them: slopsquatting. A dependency called openai-sdk or stripe-sdk is either a wrong guess at the real package or something you never meant to run.

Example

Flaggedpackage.json
{
  "dependencies": {
    "openai-sdk": "^1.0.0",
    "stripe-sdk": "^2.1.0"
  }
}
Fixedpackage.json
{
  "dependencies": {
    "openai": "^4.0.0",
    "stripe": "^18.0.0"
  }
}

How to fix

Look the package up on npm before you rely on it. If you meant the official one (openai, stripe, @supabase/supabase-js, @prisma/client), install that instead and update the imports.

Reference

In the output
Findings carry "ruleId": "phantom-dependency" in --json and the same id in SARIF and in the terminal.
Silence one line
// prodlint-disable-next-line phantom-dependency
Silence a whole file
// prodlint-disable phantom-dependency at the top of the file
How it works
Matches text patterns. Source on GitHub