Malicious Package Detection
CodeStax scans your dependencies for known malicious packages and suspicious naming patterns that may indicate supply chain attacks.
What It Detects
Known Malicious Packages
CodeStax integrates with global threat intelligence databases to check your dependencies against known malicious packages. These are tracked under known malicious package advisories and include packages that contain malware, exfiltrate data, or execute unauthorized code during installation.
Typosquatting and Suspicious Naming Patterns
Advanced detection algorithms identify typosquatting, dependency confusion, and known malicious packages.
Risk Levels
| Level | Meaning |
|---|---|
| Safe | No malicious indicators detected |
| Suspicious | Naming heuristics flagged a potential typosquat or unusual pattern |
| Dangerous | Package matches a known malicious package advisory |
Checking for Malicious Packages
Malicious package detection is available via the API endpoint. You can query the API to check your dependencies:
- Call the malicious package check API endpoint for your repository
- Review any packages flagged as Dangerous or Suspicious in the response
- Inspect the detection reason and advisory details
- Take action — remove, replace, or verify the package
How to Respond to Alerts
- Dangerous — Remove the package immediately and audit your project for signs of compromise
- Suspicious — Verify the package is legitimate by checking its registry page, maintainer, and download count
- Safe — No action needed
Popular Packages Monitored for Typosquatting
CodeStax maintains a watchlist of high-value packages commonly targeted by typosquatting attacks, including lodash, express, react, axios, requests, flask, django, numpy, and pandas.
Best Practices
- Review Dangerous alerts immediately — These indicate confirmed malware in your dependency tree
- Audit Suspicious packages — A flagged package may be legitimate but deserves a second look
- Use lock files — Lock files prevent unexpected package substitution during installs
- Enable SCA scans on every PR — Catch malicious packages before they reach your main branch