Skip to main content

OWASP LLM Top 10 Coverage

Rigour provides Strong coverage for all 10 OWASP risks identified in the "Top 10 Risks for Code Generated by LLM" (SonarQube/OWASP, 2025 v2).

Rigour Demo


Coverage Matrix

#OWASP RiskRigour Gate(s)Coverage
1Injection Flaws — SQL injection, command injection, XSSsecurity-patterns — SQL injection, command injection, XSS, eval with user inputStrong
2Broken Authentication — hardcoded passwords, weak authsecurity-patterns — hardcoded secrets, weak crypto detectionStrong
3Sensitive Data Exposure — hardcoded keys, leaked secretssecurity-patterns — API keys, tokens, passwords; hooks real-time blockingStrong
4Hallucinated Dependencies — non-existent packageshallucinated-imports — verifies every import against node_modules and registryStrong
5Improper Error Handling — missing try/catch, unhandled promisespromise-safety + error-handling — catches floating promises, missing error boundariesStrong
6Unsafe Output Handling — reflected user input, template injectionsecurity-patterns — response reflection, template injection, eval with user inputStrong
7Denial of Service — ReDoS, resource exhaustionsecurity-patterns — dynamic regex from user input, nested quantifiersStrong
8Missing Input Validation — raw body parsing, type assertionssecurity-patterns — JSON.parse without validation, as any assertionsStrong
9Overly Permissive Code — CORS wildcards, chmod 777security-patterns — CORS wildcard origin, 0.0.0.0 binding, chmod 777, wildcard headersStrong
10Insufficient Code Quality — duplication, complexity, dead codefile-size + ast-complexity + duplication-drift + content-checkStrong

10 out of 10 OWASP LLM code risks have Strong coverage via Rigour's deterministic quality gates.


AI Drift Detection (Beyond OWASP)

Rigour also catches AI-specific issues not covered by traditional OWASP lists:

IssueGateDescription
Hallucinated Importshallucinated-importsAI models fabricate package names that don't exist
Floating Promisespromise-safetyAI often forgets await on async calls
Context Window Artifactscontext-window-artifactsLeftover debugging code, placeholder text from AI context
Duplication Driftduplication-driftAI generates similar code blocks instead of reusing existing patterns

Real-Time Prevention with Hooks

Hooks catch OWASP risks before code is committed:

Agent: Write → src/auth.ts
const API_KEY = "sk-live-4f3c2b1a..."

[rigour/hook] CRITICAL [security-patterns] src/auth.ts:3
→ Possible hardcoded secret or API key (OWASP #3)

See Real-Time Hooks for setup instructions.


Peer-Reviewed Research

The approach behind Rigour's deterministic quality gates is documented in a peer-reviewed whitepaper:

Singh, A. (2025). Deterministic Quality Gates and Governance for AI-Generated Code in Regulated Software Systems. Zenodo. DOI:10.5281/zenodo.18673564


Next Steps