8000 GitHub - alahmadics/vibecurb: Prevent insecure vibe coding. Scans for secrets, suggests fixes, keeps your code secure. Β· GitHub
[go: up one dir, main page]

Skip to content
alahmadicsPublic
forked from Mofuhidy/vibecurb

About

Prevent insecure vibe coding. Scans for secrets, suggests fixes, keeps your code secure.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Β 
Β 

Latest commit

Β 

History

41 Commits

Folders and files

Repository files navigation

πŸ”’ vibecurb

Security layer for vibe-coded apps

Features β€’ Installation β€’ Usage β€’ AI Integration β€’ Network Security


🎯 What is vibecurb?

vibecurb prevents insecure vibe coding from happening. Instead of scanning apps after they're built, it acts as a security layer that catches secrets before they reach your codebase.

"We don't scan vibe-coded apps. We prevent insecure vibe coding from happening."

✨ Features

Secret Detection (14+ Patterns)

  • βœ… API Keys - Generic, AWS, GitHub, Stripe, Google
  • βœ… Authentication - Bearer tokens, JWT, passwords, private keys
  • βœ… Database - Connection strings (MongoDB, PostgreSQL, MySQL, Redis)
  • βœ… Communication - Slack tokens, email addresses
  • βœ… Smart Filtering - Ignores test data (FAKE_ prefix) and placeholders

Network Security Scanner

Detect sensitive data exposure in:

  • 🌐 Console Logging - User objects, auth headers, API responses
  • 🌐 HTTP Requests - Hardcoded auth in fetch/axios, API keys in URLs
  • 🌐 API Responses - Full user objects, database documents, stack traces
  • 🌐 Error Handling - Raw errors exposed to clients
  • 🌐 CORS Configuration - Wildcard origins, insecure headers

Auto-Fix

  • πŸ”§ Extract secrets to .env files automatically
  • πŸ”§ Replace code with process.env references
  • πŸ”§ Create backups before modifying files
  • πŸ”§ Update .gitignore to exclude .env files

AI Integration

  • πŸ€– Universal AI support - Works with Cursor, GitHub Copilot, Claude, etc.
  • πŸ€– AI instructions included for all major tools
  • πŸ€– Prevents secrets at generation time

πŸš€ Installation

# Global install
npm install -g vibecurb

# Or local install
npm install --save-dev vibecurb

πŸ“– Usage

Scan for Secrets

# Scan current directory
vibecurb scan

# Scan specific path
vibecurb scan ./src

# Auto-fix detected secrets
vibecurb scan --fix

# Preview fixes without applying
vibecurb scan --dry-run

# Filter by severity
vibecurb scan --severity error

# JSON output for CI/CD
vibecurb scan --json

Scan Network Security

# Scan for logging/API exposure issues
vibecurb scan-network

# Scan specific directory
vibecurb scan-network ./src

# Output as JSON
vibecurb scan-network --json

Example output:

🌐 Scanning network security: ./src

❌ ERROR [logging]
   πŸ“„ api.js:15
   Console logging may expose user data
   Match: console.log(user)
   Fix: Use a structured logger with data redaction

❌ ERROR [request]
   πŸ“„ config.js:8
   Hardcoded authorization header in fetch request
   Match: fetch("/api", { headers: { Authorization: "Bearer token123" } })
   Fix: Use environment variables for tokens

⚠️ WARNING [response]
   πŸ“„ routes.js:42
   API response may expose full user object
   Match: res.json({ user: req.user })
   Fix: Select only necessary fields before sending response

πŸ“Š Summary by Category:
logging: 1
request: 1
response: 1
error-handling: 0

πŸ“Š Overall:
❌ 2 error(s) found
⚠️ 1 warning(s) found

Command Aliases

vibecurb scan      # Full name
vibe scan          # Short & memorable

vibe scan-network  # Short alias

Note

By default, vibecurb ignores node_modules, dist, build, .git, coverage, .env, .env.local, and .next directories.

πŸ€– AI Integration

vibecurb provides security instructions for AI coding assistants:

Supported Tools

  • βœ… Cursor - .cursorrules file
  • βœ… GitHub Copilot - .github/copilot-instructions.md
  • βœ… Claude - AI_INSTRUCTIONS.md
  • βœ… Antigravity - Via instructions file
  • βœ… Wildsurf - Via instructions file
  • βœ… Any AI - Universal instructions included

Setup

  1. Copy AI instructions to your project:
cp node_modules/vibecurb/.cursorrules ./.cursorrules
cp node_modules/vibecurb/.github/copilot-instructions.md ./.github/
  1. AI will now:
    • Use environment variables for secrets
    • Never log sensitive data
    • Suggest vibecurb before committing

πŸ›‘οΈ Security Checklist

Before committing code, vibecurb checks for:

Secrets:

  • No API keys in code
  • No database passwords
  • No private keys
  • No hardcoded tokens

Network:

  • No console.log of user data
  • No auth headers in logs
  • No full objects in API responses
  • No stack traces in error responses

Best Practices:

  • All secrets in .env
  • .env in .gitignore
  • No debugger statements
  • Proper CORS configuration

πŸ§ͺ Testing Safe Code

Use FAKE_ prefix in tests:

// βœ… Safe - will be ignored
const apiKey = "FAKE_API_KEY_001";
const email = "FAKE_EMAIL_001@test.com";

// ❌ Will be detected
const apiKey = "sk-live-actual-secret-key";

πŸ—οΈ Development

# Clone repository
git clone https://github.com/Mofuhidy/vibecurb.git
cd vibecurb

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run in development
npm run dev

πŸ”§ Configuration

Create .vibecurbrc.json:

{
  "extensions": [".js", ".ts", ".jsx", ".tsx"],
  "exclude": ["node_modules", "dist", "build"],
  "severity": "all"
}

πŸ“¦ NPM Package

# Install globally
npm install -g vibecurb

# Use immediately
vibecurb scan

🀝 Contributing

Contributions welcome! Please read our Contributing Guide.

πŸ“„ License

MIT Β© Mofuhidy

πŸ™ Acknowledgments


About

Prevent insecure vibe coding. Scans for secrets, suggests fixes, keeps your code secure.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0