All articles
Security 10 min readFebruary 5, 2025

The 7 Security Vulnerabilities Most Likely to Survive Your Code Review

Human reviewers systematically miss certain classes of security bugs — not because they don't know better, but because of how code review actually works under time pressure.

Security vulnerabilities don't usually look dangerous when you read them. That's why they survive code review.

A reviewer looking at a SQL query constructor sees data assembly. The fact that user input flows into that assembly without sanitization is only obvious when you zoom out to the full data path — which spans multiple files and function calls that no reviewer is holding simultaneously in their head during a typical async review.

After analyzing security issues detected across our platform, seven vulnerability classes survive code review at dramatically higher rates than others. Every one of them exploits a structural weakness in how humans read code.

1. Injection Flaws

SQL, command, LDAP, and XML injection share a common trait: the vulnerability is contextual, not local. The dangerous line often looks fine in isolation. The problem is what came before it, sometimes in a different file entirely. Reviewers who read sequentially through a diff miss cross-file data flows.

2. Insecure Direct Object Reference (IDOR)

IDOR bugs occur when an API endpoint uses a user-supplied ID without verifying that the authenticated user owns that resource. In a diff, the missing authorization check is invisible — you'd need to know that the check should be there, not just that it isn't. Reviewers approve what they see; they can't easily spot what's absent.

3. Hardcoded Secrets

Hardcoded API keys and tokens survive review because reviewers acclimate to strings in code. A string that looks like a configuration value gets mentally categorized as "probably fine" during a fast-moving review. CodeMouse catches these with pattern matching that doesn't habituate.

4. Race Conditions and TOCTOU Flaws

Time-of-check to time-of-use vulnerabilities require holding a mental model of concurrent execution while reading sequential code. Human reviewers are poor at this — concurrent reasoning is computationally expensive for brains built on single-threaded cognition. These bugs are caught far more reliably by tools that explicitly model concurrency.

5. Insecure Deserialization

When user-supplied data is deserialized without validation, the vulnerability lives at the point of deserialization — but the danger is in what that data can do after deserialization. Reviewers approve the deserialization call without fully tracing the downstream execution path it enables.

6. Missing Security Headers

What's not there can't be reviewed. Missing Content-Security-Policy headers, missing HSTS, missing X-Frame-Options — these are invisible in a diff because they represent code that was never written. Automated checks that verify the expected headers are present will catch these; humans reviewing present code won't.

7. Verbose Error Messages

Stack traces and detailed error messages shipped to the client leak internal architecture. In a diff, they appear as debugging conveniences — because during development, that's what they are. Reviewers approve them without thinking about the information exposure they represent in production.

The Common Thread

Every vulnerability class on this list exploits the same structural weakness: human code review evaluates code as it's written, not code in the context of its full execution environment, concurrent users, or missing complement. Building review processes that account for what code doesn't do is as important as reviewing what it does.

Try CodeMouse on your next PR

Free AI code review on every pull request. Bring your own API key — no subscription needed.

Install on GitHub — Free