Huntress Acquires Inside Agent: A New Era for Identity ProtectionFree Trial
Back to Blog
Application Security

Secure Code Review: What Senior Engineers Actually Look For

Automated tools find about 40% of security vulnerabilities in code. The other 60% — business logic flaws, race conditions, authorization bypasses, and subtle injection vectors — require human eyes. Af…

30 Mar 20262 min read0 views

Introduction

Automated tools find about 40% of security vulnerabilities in code. The other 60% — business logic flaws, race conditions, authorization bypasses, and subtle injection vectors — require human eyes. After fifteen years of reviewing code for security, here is what I actually look for in a code review, beyond what any scanner will catch.

Authorization, Not Just Authentication

Most code reviews verify that endpoints require authentication — "is there an auth check?" But the critical question is authorization: "Can this authenticated user perform this action on this resource?" I look for object-level authorization checks on every endpoint that accesses a resource by ID. If the code fetches a record by ID from the request and returns it without verifying that the authenticated user owns or has access to that record, that is IDOR (Insecure Direct Object Reference), and it is the most common vulnerability I find in code reviews.

Race Conditions and Time-of-Check-to-Time-of-Use

Check balance, then debit account. Check inventory, then process order. Check permission, then perform action. Any time there is a gap between checking a condition and acting on it, an attacker can modify the condition between the check and the action. I look for operations that should be atomic but are not — especially in financial transactions, resource allocation, and permission checks.

The fix depends on the context: database transactions with appropriate isolation levels, optimistic locking, or mutex/semaphore patterns. The important thing is recognizing the pattern during review.

Data Flow Through Trust Boundaries

I trace data from its entry point (user input, API call, file upload, message queue) through every function it passes through until it reaches a sink (database query, command execution, file system operation, HTML rendering). At each trust boundary, I ask: is this data validated? Is it encoded appropriately for its destination? Can it break out of its intended context?

The most dangerous flows cross multiple trust boundaries: user input that is stored in a database, retrieved by a different service, and rendered in an admin dashboard. Each service might trust data from the database, but the original user input was never sanitized. These second-order injection vulnerabilities are invisible to scanners and easy to miss in reviews if you only look at individual functions rather than the full data flow.

Error Handling and Information Disclosure

Stack traces, database error messages, internal IP addresses, version numbers — all of these leak through poor error handling and all of them help attackers map your application's internals. I look for generic catch blocks that log the full exception to the user, debug flags that are checked at runtime (and might be enabled in production), and error messages that include internal identifiers or system paths.

A security-conscious code review is slower than a functional code review. But finding a vulnerability before deployment costs 100x less than finding it in production — and infinitely less than finding it in a breach investigation.

Comments

Keep Reading

Explore Related Topics and Insights

Insider Threat Detection Without Becoming Big Brother
EMERGING THREATS

Insider Threat Detection Without Becoming Big Brother

Insider threat programs have a PR problem. Announce that you are monitoring employee behavior and you will get pushback from HR, legal, works councils, and the employees themselves. And they are not w…

S

Spakto Team

30 Mar 2026
Read article →
Cloud Security Posture Management: Choosing and Deploying CSPM
CLOUD SECURITY

Cloud Security Posture Management: Choosing and Deploying CSPM

When I ran a cloud security assessment for a logistics company last year, we found 847 misconfigurations across their AWS and Azure environments. Seventeen of them were critical — including an S3 buck…

S

Spakto Team

30 Mar 2026
Read article →
Threat Hunting: Moving From Reactive to Proactive Security
THREAT INTELLIGENCE

Threat Hunting: Moving From Reactive to Proactive Security

Your SIEM generates alerts. Your EDR generates alerts. Your firewall generates alerts. You triage them, you respond to them, you close them. And then one day you discover that an attacker has been in…

S

Spakto Team

30 Mar 2026
Read article →
Securing the Software Build Pipeline: From Code to Production
APPLICATION SECURITY

Securing the Software Build Pipeline: From Code to Production

Your CI/CD pipeline is the most privileged system in your organization. It has access to source code, secrets, production credentials, cloud provider APIs, and the ability to deploy code that your use…

S

Spakto Team

30 Mar 2026
Read article →
Building a Security Culture That Outlasts Your CISO
EMERGING THREATS

Building a Security Culture That Outlasts Your CISO

I have seen security programs thrive under one CISO and collapse under their successor. I have seen organizations where security is everyone's responsibility and organizations where it is "the securit…

S

Spakto Team

30 Mar 2026
Read article →
Zero-Day Markets: The Economics of Vulnerability Trading
EMERGING THREATS

Zero-Day Markets: The Economics of Vulnerability Trading

A zero-day exploit for iOS full-chain remote code execution with persistence is worth between $1 million and $2.5 million on the private market. An Android equivalent fetches $2 to $2.5 million. A Chr…

S

Spakto Team

30 Mar 2026
Read article →
OT/ICS Security: Bridging the IT-OT Divide
EMERGING THREATS

OT/ICS Security: Bridging the IT-OT Divide

I spent the first half of my career in IT security and the last decade increasingly focused on operational technology. The cultural divide between IT and OT is wider than the technical one, and until…

S

Spakto Team

30 Mar 2026
Read article →
Quantum Computing and Cryptography: Preparing for Q-Day
EMERGING THREATS

Quantum Computing and Cryptography: Preparing for Q-Day

Q-Day — the day a quantum computer can break RSA-2048 and ECC in practical time — is not here yet. Estimates range from 2030 to 2040, with considerable uncertainty. But if you wait for Q-Day to start…

S

Spakto Team

30 Mar 2026
Read article →