
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
cleaner-code
Advanced tools
Scans AI-generated code for invisible Unicode, Trojan Source, and supply-chain threats.
AI code security scanner as a Model Context Protocol (MCP) server. Detects hidden threats in AI-generated code that traditional linters miss.
Website: codesafer.org · MCP Clients: Claude Code, Cursor, VS Code + Copilot, Cline
AI coding assistants generate code fast — but who's checking it for hidden threats?
Recent supply-chain attacks show that malicious code can hide in ways human reviewers and traditional linters routinely miss:
.cursorrules, CLAUDE.md, and other AI config filespackage.jsoneval + base64, reverse shells, packed payloadsCodeSafer scans for all of these before the code runs on your machine.
CodeSafer runs as a local MCP server. Your AI client (Claude Code, Cursor, etc.) calls its tools when reviewing or generating code, and findings are returned inline.
Hybrid detection:
Nothing leaves your machine. The AI analysis runs locally against a tokenizer server.
| Capability | Details |
|---|---|
| Invisible character detection | 30+ Unicode variants including Zero-Width Space, Mongolian Vowel Separator |
| BiDi / Trojan Source | Full CVE-2021-42574 coverage |
| Homoglyph detection | Cyrillic/Greek/Latin confusables (CVE-2021-42694) |
| Unicode steganography | Glassworm-style whitespace payloads |
| Rules file backdoors | Scans .cursorrules, CLAUDE.md, .claude/, Cursor rules |
| Dependency scanning | Typosquatting + suspicious install scripts in package.json |
| Obfuscation detection | eval + base64, reverse shells, packed payloads |
| AI deep analysis | CodeBERT transformer classifier with confidence scores |
| MCP native | 6 MCP tools, stdio transport |
| Local-first | No code uploaded — runs entirely on your machine |
CodeSafer exposes six tools to your MCP client:
| Tool | Purpose |
|---|---|
scan_file | Scan a single file for hidden malicious code patterns |
scan_directory | Recursively scan a directory across all source files |
scan_rules_file | Scan an AI configuration/rules file for prompt injection and Rules File Backdoor attacks |
check_dependencies | Check package.json for typosquatting, suspicious install scripts, and dependency risks |
ai_analyze | Deep AI analysis using the trained CodeBERT model (classifies chunks as malicious/benign with confidence) |
explain_finding | Get detailed explanation of a specific threat category, with attack scenarios and remediation |
git clone https://github.com/goldmembrane/cleaner-code.git
cd cleaner-code
npm install
npm run build
Claude Code (~/.claude.json or project .mcp.json):
{
"mcpServers": {
"codesafer": {
"command": "node",
"args": ["/absolute/path/to/cleaner-code/dist/index.js"]
}
}
}
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"codesafer": {
"command": "node",
"args": ["/absolute/path/to/cleaner-code/dist/index.js"]
}
}
}
Restart your client, and CodeSafer tools will appear in the tool picker.
Once configured, ask your AI client things like:
.cursorrules for a rules-file backdoor."src/auth.ts."The client will call the appropriate MCP tool and return findings with severity, line numbers, and remediation guidance.
CodeSafer is free to use. Static analysis (scan_file, scan_directory, scan_rules_file, check_dependencies, explain_finding) has no limits.
AI deep analysis (ai_analyze) includes 10 free runs per session. Paid plans for higher AI quotas are available at codesafer.org.
CodeSafer detects threats across 9 categories:
.cursorrules, CLAUDE.md, etc.eval + base64, packed payloads, reverse shellscleaner-code/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── api-server.ts # Optional HTTP API server
│ ├── types.ts # Scanner interfaces
│ ├── utils.ts # File collection, summary formatting
│ └── scanner/
│ ├── invisible.ts # Invisible Unicode scanner
│ ├── bidi.ts # BiDi / Trojan Source scanner
│ ├── homoglyph.ts # Homoglyph scanner
│ ├── encoding.ts # Encoding / charset scanner
│ ├── obfuscation.ts # Obfuscation pattern scanner
│ ├── steganography.ts # Unicode steganography scanner
│ ├── rules-backdoor.ts # Rules file backdoor scanner
│ ├── dependency.ts # Dependency risk scanner
│ └── ai-analyzer.ts # CodeBERT deep analyzer
├── ml/ # ML model assets and tokenizer
├── functions/ # Cloud function deployments
├── deploy/ # Deployment manifests
└── web/ # Landing page assets
ISC — see the LICENSE file for details.
FAQs
Scans AI-generated code for invisible Unicode, Trojan Source, and supply-chain threats.
We found that cleaner-code demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.