Vchk – Security scanner for AI-generated code
quality 7/10 · good
0 net
vchk — Security Scanner for AI-Generated Code Security for AI Code Your AI wrote the code. Who checked the security? vchk finds the vulnerability patterns that AI coding tools systematically introduce — SQL injection, hardcoded secrets, XSS, hallucinated packages, and more. Try it in your browser $ npx vchk copy 45% of AI code has security flaws Veracode 5.1× more SQL injection with AI Perry et al. 1 in 5 breaches from AI code Aikido 2026 vchk — scanning main.py 1 import sqlite3 2 import random 3 4 API_KEY = "sk-proj-abc123def456ghi789" 5 6 def get_user (username): 7 query = f "SELECT * FROM users WHERE username = '{username}'" 8 cursor.execute(query) 9 return cursor.fetchone() 10 11 def generate_token (): 12 return str(random.randint( 100000, 999999 )) Findings CRITICAL VC-018 L 4 Hardcoded API Key API key embedded in source code CRITICAL VC-001 L 7 SQL Injection via String Interpolation f-string in SQL query with user input HIGH VC-025 L 12 Weak Random Number Generator random.randint() used for token generation 3 findings: 2 critical · 1 high · Scanned in 0.3s The Problem AI writes fast. It doesn't write safe. 01 It copies insecure patterns AI models trained on millions of repos — including millions of insecure ones. When you ask for a database query, you get string concatenation because that’s what appeared most in training data. The code works. The vulnerability is invisible. 02 It makes you overconfident Stanford research found that developers using AI assistants believe their code is MORE secure while actually producing LESS secure code. The code looks clean, passes basic tests, and gets merged without scrutiny. 03 Existing tools weren’t built for this ESLint, Semgrep, Snyk — built for human-written code. They miss the specific patterns AI produces: hallucinated packages that don’t exist, “almost right” auth flows, tests that only test the happy path. Detection Rules 8 rules. Zero false positives. CRITICAL SQL Injection String concatenation in database queries instead of parameterized queries query = f"SELECT * FROM users WHERE name = '{name}'" CRITICAL Hardcoded Credentials API keys, passwords, and secrets embedded directly in source code API_KEY = "sk-proj-a8f3..." CRITICAL Missing Authentication API endpoints handling sensitive data with no auth middleware app.delete( '/api/users/:id', handler) CRITICAL Hallucinated Packages Dependencies that don’t exist in npm/PyPI — AI invented the name "flask-security- utils": "^2.1.0" HIGH Cross-Site Scripting dangerouslySetInnerHTML, innerHTML with unsanitized user content res.send( `