Security scanner for AI-generated code
Project description
🔒 VibeSec
Security scanner for AI-generated code.
45% of AI-generated code ships with critical vulnerabilities. Cursor, Claude Code, Bolt, and Lovable generate insecure patterns that existing tools miss. VibeSec catches them before you deploy.
$ vibesec scan ./my-cursor-app
VibeSec v0.1.0 — AI-Generated Code Security Scanner
● CRITICAL 7 findings
● HIGH 2 findings
CRITICAL — Hardcoded Secret
File: src/lib/supabase.ts Line: 12
Found: SUPABASE_SERVICE_KEY hardcoded in source code
Fix: Move to environment variables. Never commit secrets to git.
CRITICAL — Supabase RLS Disabled
File: supabase/migrations/001_init.sql Line: 34
Found: ALTER TABLE users DISABLE ROW LEVEL SECURITY
Fix: Enable RLS + add user isolation policies.
9 findings in ./my-cursor-app
Why VibeSec
Existing tools like Semgrep, Snyk, and CodeQL are great — but they were built for human-written code. AI tools generate specific anti-patterns that these scanners miss:
| Pattern | Semgrep | Snyk | VibeSec |
|---|---|---|---|
| Hardcoded secrets | ✓ | ✓ | ✓ |
| Supabase RLS disabled | ✗ | ✗ | ✓ |
| Hallucinated npm packages | ✗ | ✗ | ✓ |
| Missing auth on scaffolded routes | Partial | ✗ | ✓ |
| Source map exposure in build config | ✗ | ✗ | ✓ |
| AI-specific JWT misuse | ✗ | ✗ | ✓ |
Install
pip install vibesec
Usage
Scan a directory:
vibesec scan ./my-project
Scan and get AI-powered fix suggestions:
vibesec scan ./my-project --fix
Export results as JSON (for CI/CD):
vibesec scan ./my-project --output json
Filter by severity:
vibesec scan ./my-project --severity critical
Ignore specific checks:
vibesec scan ./my-project --ignore rls,cors
What VibeSec Checks
🔴 CRITICAL
1. Hardcoded Secrets API keys, passwords, tokens, and database URLs hardcoded in source files. LLMs replicate tutorial patterns where secrets are hardcoded.
# VibeSec catches this
api_key = "sk-abc123..."
SUPABASE_SERVICE_KEY = "eyJhbGci..."
stripe_secret = "sk_live_..."
2. Supabase RLS Disabled Row Level Security disabled — any authenticated user can read or modify all data. LLMs skip RLS to make queries work quickly in scaffolding.
-- VibeSec catches this
ALTER TABLE users DISABLE ROW LEVEL SECURITY;
🟡 HIGH
3. Missing Route Authentication Admin and sensitive API routes scaffolded without authentication middleware. LLMs build the happy path without thinking about access control.
4. Hallucinated Packages npm packages that don't exist — a typosquatting attack surface. LLMs generate plausible-sounding package names that aren't real.
// VibeSec catches this
"react-auth-handler": "^1.0.0",
"supabase-helpers": "^2.1.0"
5. Source Map Exposure
Build config exposes full source code via .map files in production.
🟠 MEDIUM
6. Unsafe JWT Handling — JWT decoded without verification, or none algorithm accepted
7. dangerouslySetInnerHTML — Direct HTML injection without sanitization
8. Client-Side Role Trust — Admin checks done using localStorage values
9. Missing Webhook Verification — Stripe/GitHub webhooks without signature check
10. Permissive CORS — Wildcard CORS with credentials enabled
GitHub Actions Integration
Add VibeSec to your CI/CD pipeline:
# .github/workflows/vibesec.yml
name: VibeSec Security Scan
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install VibeSec
run: pip install vibesec
- name: Run Security Scan
run: vibesec scan . --output json --severity high
Development
git clone https://github.com/AyushkhatiDev/vibesec
cd vibesec
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pytest tests/
Contributing
VibeSec is open source and contributions are welcome.
Adding a new rule:
- Create
vibesec/rules/your_rule.py - Implement
check_your_rule(file_path, content) -> list[dict] - Register it in
vibesec/rules/__init__.py - Add test cases in
tests/corpus/ - Open a PR
Each finding must return:
{
"rule": "Rule Name",
"severity": "CRITICAL|HIGH|MEDIUM|LOW",
"file": file_path,
"line": line_number,
"message": "What was found",
"fix_hint": "How to fix it",
"code_snippet": "offending line"
}
See CONTRIBUTING.md for full guide.
Roadmap
- Secrets detection
- Supabase RLS checker
- Missing auth on routes
- Hallucinated package detector
- Source map exposure
- JWT misuse rules
- dangerouslySetInnerHTML
- Client-side role trust
- Webhook verification
- Permissive CORS
- GitHub Action marketplace listing
- Web app (paste URL → get report)
- SARIF output for GitHub Security tab
- VS Code extension
Built By
Ayush Khati — BCA student building real tools for real problems.
Found a bug? Open an issue. Want a rule added? Start a discussion.
License
MIT — free to use, modify, and distribute.
Built because 45% of vibe-coded apps ship with critical vulnerabilities. Someone had to fix that.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vibesec-0.1.0.tar.gz.
File metadata
- Download URL: vibesec-0.1.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7351002dac1317afc57b3915e02a022a9119aead8fc21446c945844cd81eb41a
|
|
| MD5 |
3db1d8c75211a01ce9e40b318310e83b
|
|
| BLAKE2b-256 |
3f5cc41b8925fe62b16434083891173d4aec712b8cb03d02df2bbfd3589bb7ec
|
File details
Details for the file vibesec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vibesec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9b31dc4e67964e8ac184ee83e4522f63a5a024f4f04288ca48a214735edddc9
|
|
| MD5 |
11200f20794599014a62b1d4763b3e4e
|
|
| BLAKE2b-256 |
62bd8c38f0f83bb1bdfa31650d070836b0d2bd9ae7cb6c127d48a27a0f6fff89
|