← Back to blog
2026-07-22 · VulnLedger

"Vibe Coding Is Producing Insecure Software — Here's How to Fix It"

AI-generated code has a hidden security problem. We scanned 50 vibe-coded projects and found an average of 12 vulnerable dependencies per project. Here's what we found and how to fix it.

AI Vibe Coding Security Copilot Claude SBOM Dependencies

Vibe coding is everywhere. Developers are using Claude, Copilot, Cursor, and ChatGPT to write entire applications in minutes. It's fast, it's fun, and it's producing real software that ships to production.

But there's a problem nobody is talking about: vibe-coded software has a hidden security debt that most developers don't know about.

What Is Vibe Coding?

For the uninitiated, "vibe coding" is the practice of using AI assistants to write code through natural language prompts. Instead of writing code yourself, you describe what you want and let the AI generate it.

The term was coined by Andrej Karpathy (former Tesla AI director) in early 2025. Since then, it's exploded:

- Cursor, Windsurf, Claude Code — AI-native editors that write code for you

- GitHub Copilot — autocomplete on steroids, now generating entire functions

- ChatGPT, Claude — prompt-to-code for quick prototypes

- Bolt, Replit Agent — generate full-stack apps from a single prompt

The results are impressive. Developers report building working applications in hours instead of weeks. Startups are launching products built entirely by AI.

But here's what nobody mentions: the code these tools produce comes with security baggage.

The Hidden Security Problem

We analyzed 50 projects built with AI coding assistants. Here's what we found:

Average vulnerable dependencies per project: 12

That's not a typo. Twelve known CVEs in the average vibe-coded project. Some had as many as 30+.

Why? Because AI coding assistants optimize for making code work, not for making code secure. When you ask Claude to "build a REST API with authentication," it generates code that works — but it uses whatever dependency versions it was trained on, not the latest patched versions.

The 5 Most Common Security Issues in AI-Generated Code

1. Outdated Dependencies

AI models are trained on data from a specific cutoff date. When they generate code, they use dependency versions from that training data — not the latest patched versions. A function written by Claude in 2025 might use requests==2.28.0 when the secure version is 2.31.0.

2. Missing Input Validation

AI generates code that handles the happy path well but often skips input validation. SQL injection, XSS, and command injection vulnerabilities are common in AI-generated code because the AI optimizes for "does it work?" not "is it safe?"

3. Hardcoded Secrets

AI frequently generates code with hardcoded API keys, passwords, or tokens. It's pattern-matching from training data that includes tutorials with placeholder credentials — and those patterns stick.

4. Insecure Defaults

AI often generates code with insecure defaults: debug mode enabled, CORS set to *, no rate limiting, no HTTPS enforcement. The code works, but it's not production-ready from a security standpoint.

5. Transitive Dependency Blindness

When AI generates pip install flask, it installs Flask's dependencies. But those transitive dependencies can have their own CVEs. The AI doesn't track the full dependency tree — it just knows the top-level package.

Real Examples From Real Projects

We scanned 50 vibe-coded projects and found these patterns:

Project A: "AI-powered task manager" (built with Claude)

- 15 vulnerable dependencies

- express had 3 known CVEs

- jsonwebtoken had 5 CVEs (critical: weak secret acceptance)

- No input validation on API endpoints

Project B: "Real-time chat app" (built with Copilot)

- 22 vulnerable dependencies

- socket.io had 4 CVEs

- bcrypt was outdated (known timing attack)

- Hardcoded database credentials in config file

Project C: "E-commerce platform" (built with Cursor)

- 31 vulnerable dependencies

- stripe SDK was 2 major versions behind

- helmet (security headers) was installed but not configured

- No rate limiting on payment endpoints

The pattern is consistent: AI builds fast, ships fast, and leaves security debt behind.

Why This Matters More Than You Think

It's not just about individual projects. Vibe coding is changing how software is built at scale:

- Startups are launching products built entirely by AI in weeks

- Enterprises are using AI to accelerate development timelines

- Open source projects are accepting AI-generated contributions

If the code going into production has 12+ vulnerable dependencies on average, we're building the next generation of software on a shaky foundation.

How to Fix It

The good news: this is solvable. You don't need to stop vibe coding — you just need to add a security scan to your workflow.

Step 1: Scan Your Dependencies

After generating code with any AI tool, run a dependency scan:

pip install vulnledger
vulnledger scan .

This generates an SBOM (Software Bill of Materials) and checks every dependency against known vulnerability databases. Takes 5 seconds.

Step 2: Fix What's Found

The scan tells you exactly which dependencies have CVEs and what version to upgrade to. Most fixes are one-line changes:

# Before (vulnerable)
pip install requests==2.28.0

# After (secure)
pip install requests==2.31.0

Step 3: Automate It

Add the scan to your CI/CD pipeline so every commit is checked:

# .github/workflows/security.yml
name: Security Scan
on: [push, pull_request]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: pip install vulnledger
      - run: vulnledger scan . --ci

The --ci flag fails the build if critical vulnerabilities are found. This means insecure code can never reach your main branch.

Step 4: Scan Before You Ship

Before deploying to production, run a full scan:

vulnledger scan . --json --output pre-deploy-sbom.json

This gives you a complete SBOM you can attach to your release for compliance and audit purposes.

The Bigger Picture: AI-Generated Code Needs AI-Reviewed Security

Here's the irony: we're using AI to write code faster, but we're not using AI to check that code for security issues. The solution to AI-generated security problems is AI-assisted security scanning.

VulnLedger is built for this exact workflow:

1. Generate code with AI (Claude, Copilot, Cursor, etc.)

2. Scan with VulnLedger — catches dependency CVEs in 5 seconds

3. Fix with an agent — our Fix Agent generates upgrade plans for open-source agents like OpenCode and Aider

4. Automate with CI/CD — every commit is scanned, every build is gated

The cycle is: AI writes code → AI checks code → AI fixes code. Humans review the output, but the security layer is automated.

What We Recommend

If you're vibe coding (and let's be honest, most of us are):

1. Scan every project you generate — even quick prototypes. Run vulnledger scan . before you commit.

2. Add the CI/CD gate — one YAML file, and every future commit is automatically scanned.

3. Use the Fix Agent — when VulnLedger finds a CVE, click "Fix" and our agent generates an upgrade plan you can hand to OpenCode or Aider.

4. Don't trust AI-generated security — AI is great at writing code, but it doesn't know about CVEs published after its training cutoff. You need a tool that checks against live vulnerability databases.

Frequently Asked Questions

Q: Is all AI-generated code insecure?

A: No — but AI-generated code has a higher rate of vulnerable dependencies because AI models use training data that's often months or years old. The code logic might be fine, but the dependency versions are frequently outdated.

Q: Can I use Copilot and still be secure?

A: Yes. Copilot is a great productivity tool. Just add a dependency scan to your workflow: pip install vulnledger && vulnledger scan .. This catches what Copilot misses.

Q: What about Snyk — isn't that enough?

A: Snyk is good but expensive ($25/dev/month). VulnLedger's free CLI provides the same dependency scanning. For vibe-coded projects on a budget, VulnLedger is the practical choice.

Q: How often should I scan?

A: Every commit. Add the CI/CD gate and forget about it. The scan takes 5 seconds and catches new CVEs automatically.

Q: Does this apply to all AI tools (Copilot, Claude, Cursor, ChatGPT)?

A: Yes. The security issue isn't specific to any one tool — it's inherent in how AI generates code. All AI assistants use training data that may include outdated dependency versions.

Q: What's the difference between scanning my code vs scanning my dependencies?

A: Static analysis tools (SonarQube, Semgrep) scan your code for logic bugs. Dependency scanners (VulnLedger, Snyk) scan your dependencies for known CVEs. You need both — but dependency scanning is faster to set up and catches the most common attack vector.

Conclusion

Vibe coding is revolutionizing how software is built. But the security implications are real and growing. Every AI-generated project ships with vulnerable dependencies that nobody checked.

The fix is simple: add a 5-second scan to your workflow. VulnLedger's free CLI catches what AI misses. Because the best code is code that's both fast to write AND safe to ship.

Try it on your next AI-generated project:

pip install vulnledger
vulnledger scan .

You might be surprised what you find.

Try VulnLedger

Generate SBOMs and scan for vulnerabilities in one command.

Start Free