Ghostimport

•
3
•
Reclamada
Gestionar

Prevent AI coding agents from installing non-existent or malicious npm packages, safeguarding your projects from slopsquatting and supply-chain risks.

Ghostimport is a critical security tool designed to protect projects from 'slopsquatting,' a novel supply-chain attack where AI coding tools hallucinate non-existent npm package names. Attackers monitor for these ghost imports, register the package, and can then execute malicious `postinstall` scripts when developers unwittingly install them. Unlike traditional audit tools, ghostimport checks package names against the live npm registry *before* installation or code write, detecting missing packages, typosquats, and packages with suspicious `postinstall` scripts, thereby stopping attacks at the source.

Características Principales

012 GitHub stars
02Detects non-existent npm packages (ghost imports) hallucinated by AI coding agents.
03Flags packages with `postinstall`, `preinstall`, or `install` scripts that run arbitrary code.
04Provides a command-line interface (CLI) for scanning directories and project-wide security audits, with CI/CD integration.
05Integrates as hooks for AI agents (e.g., Claude, Cursor) to block unsafe package installations in real-time.
06Identifies typosquatting risks by comparing package names to popular alternatives.

Casos de Uso

01Integrating directly with AI coding agents to prevent the installation of non-existent or malicious npm packages during development.
02Scanning existing TypeScript/JavaScript projects to identify and remediate ghost imports and supply-chain vulnerabilities.
03Implementing pre-commit hooks or CI/CD checks to ensure no risky or hallucinated packages are introduced into the codebase.