Course contentsShow
← Security
Lesson 2101 of 3,05242. Penetration Testing and Red TeamingFree lesson

Manual Code Review Techniques

Read source code to identify injection points, authentication flaws, and logic errors missed by automated tools.

Manual Code Review Techniques

What you'll learn: How to manually inspect source code to uncover security flaws that automated scanners miss.

Why Manual Review Matters

Automated tools excel at finding known patterns, but security vulnerabilities often hide in business logic and context-specific flows. Manual code review lets you trace how data moves through an application, understand developer intent, and spot subtle flaws that require human reasoning.

Think of automated scanners as spell-checkers—they catch common mistakes, but only a human reviewer can tell if the story makes sense.

Core Manual Review Techniques

Trace User Input Flows

Follow untrusted data from entry points (HTTP parameters, file uploads, API calls) through the application. Ask: Is this input validated? Sanitized? Escaped before use? Look for injection points where user data reaches SQL queries, command executions, or templates without proper encoding.

Examine Authentication Logic

Read authentication code line-by-line. Check for hardcoded credentials, weak password requirements, missing brute-force protections, or flawed session management. Verify that logout truly invalidates sessions and that password resets can't be bypassed.

Analyze Authorization Checks

Search for access control decisions. Are permission checks present before sensitive operations? Can users manipulate IDs to access others' data (IDOR)? Look for missing checks in edge cases or alternate code paths.

Hunt Logic Errors

Business logic flaws require understanding what the code should do. Review workflows for race conditions, state manipulation, price calculation errors, or sequence bypasses. Ask: What happens if I perform steps out of order?

Review Context Switching

Examine boundaries where data changes format or trust level—database to UI, internal API to external service, privileged to unprivileged context. These transitions often lack proper encoding or validation.

Key Takeaway: Manual code review uncovers context-dependent vulnerabilities through systematic tracing of data flows, authentication/authorization logic, and business rules that automated tools cannot understand.