Notes
Where to focus
You cannot read every line with equal attention, so focus where risk concentrates. Trust boundaries, where untrusted input enters the system. Authentication and session handling. Authorization checks, the top source of real bugs. Anything touching money, personal data or secrets. How cryptography is used. The dangerous operations: file uploads, deserialization, and outbound calls that could be SSRF. And new dependencies, which bring in other people's code. If your time is limited, these areas repay it the most.
- trust boundaries: where untrusted input enters
- authentication and session handling
- authorization checks
- anything touching money, PII or secrets
- cryptography usage
- file uploads, deserialization, external calls (SSRF)
- new dependencies
Follow the data
The core technique is to follow the data. Find the entry points: request parameters, bodies, headers, uploaded files, queue messages. Then trace each piece of untrusted input to where it is finally used, the sink. At the sink, ask the injection-episode questions: is it validated, encoded, parameterised, authorized? The dangerous sinks are SQL, HTML, shell, file paths, redirects, templates and deserializers. Most injection and access-control bugs are found this way, by connecting input to a sink.
- 1. find entry points: request params, bodies, headers, files, messages
- 2. follow each to where it is used (the sink)
- 3. ask at the sink: is it validated? encoded? parameterised? authorized?
- sinks: SQL, HTML, shell, file paths, redirects, templates, deserializers
A review checklist
Carry a checklist, grounded in the OWASP Top 10, and turn each category into a question. Access control: ownership checked, not just role? Injection: queries parameterised and output encoded? Authentication: MFA, sessions and tokens handled right? Cryptography: strong algorithms, no hard-coded keys? Secrets: none in code or logs? Error handling: nothing sensitive leaked, input validated? A written checklist keeps you from reviewing only the bug you happened to think of.
- access control: ownership, not just role?
- injection: parameterised? output encoded?
- authn: MFA, session, tokens handled right?
- crypto: strong algorithms, keys not hard-coded?
- secrets: none in code/logs?
- errors: nothing leaked? input validated?
PR vs whole codebase
There are two modes. Reviewing a pull request is small and frequent: focus on what changed and what it touches. The useful question is whether this change adds a new entry point, a new dangerous sink, or a new trust decision like an authorization check, and whether each is handled safely. Auditing a whole codebase is large and rare: map entry points and data flows first, then dig into the high-risk areas. Most review time is pull requests, so ask those three questions on every change.
- pull request review: small, frequent; focus on what changed and what it touches (new endpoint? new query?)
- codebase audit: large, rare; map entry points and data flows first, then dig
- for a PR, ask: does this change add an entry point, a sink, or a trust decision?
Pair with tools
Do not do by hand what a tool does well. Run static analysis and secret scanning first, and triage their output, covered next episode. Let tools cover mechanical patterns, like a formatted SQL string or a weak hash. Spend human attention on what tools cannot judge: business logic, authorization, cryptography, and chains where small issues combine. Use the diff and the pull request description for context. The division is simple: tools find more lines, humans find the serious bugs.
- run SAST and secret scanning first; triage the output
- let tools cover the mechanical patterns
- spend human attention on logic, authz, crypto, and chains
- use diffs and PR description for context
- tools find lines; humans find the serious bugs
Write good findings
The output of review is findings, and a finding a developer cannot act on changes nothing. A useful one has the exact location, what is wrong and the concrete impact here, how to trigger it, and a specific fix, ideally with a code suggestion. Rate severity honestly, so important things stand out. Mind the tone: comment on the code, not the person, and explain the why so the pattern is learned. Review is also teaching, and that is how a team's security improves.
- exact location: file, line, function
- what is wrong, and the concrete impact here
- how to trigger it
- a specific fix, with a code suggestion where possible
- severity, honestly rated
- tone: about the code, not the person; teach
Build the habit
Review works best as a routine, not an event. Flag high-risk pull requests for security review, the ones touching auth, data or crypto, rather than every typo fix. Put a short checklist in the pull request template so authors self-review. Have security champions review within their own teams, which scales better than one central reviewer. Let threat model findings tell you what to look for. And feed recurring bugs back into static analysis rules and guidelines, so they are caught automatically next time.
- security review on high-risk PRs, not every typo fix
- a lightweight checklist in the PR template
- security champions review within their teams
- threat model findings tell you what to look for feed recurring bugs back into SAST rules and guidelines
Common mistakes
Mistakes. Reviewing style and naming instead of security. Reading only the diff without the surrounding context that gives it meaning. Skipping authorization and business logic, the very things tools are blind to. Vague findings with no concrete fix. Rating everything critical, so nothing stands out. Doing by hand what a scanner does well, or conversely ignoring the scanner entirely. And no follow-up to confirm the fix actually landed, so the finding quietly expires unresolved.
- reviewing style, not security
- reading the diff without its context
- skipping authz and logic (where tools are blind)
- vague findings with no fix
- rating everything critical
- doing by hand what a scanner does, or ignoring it
- no follow-up on the fix
Say it like this
In the interview: I focus where risk concentrates, trust boundaries, auth, data handling and cryptography. My core technique is to follow untrusted input from entry points to its sinks and check validation, encoding, parameterisation and authorization, against an OWASP-based checklist. I run static analysis and secret scanning first for breadth, and spend human attention on logic, authz and crypto, which tools miss. And findings have exact locations, impact and a concrete fix.
- "I focus on trust boundaries, auth, data handling and crypto. I follow untrusted
- input to its sinks and check
- validation, encoding, parameterisation and authorization, against an OWASP-based checklist. Tools
- first for breadth, humans for logic. Findings are specific, fixable."