Picture a release candidate that goes through the pipeline green. The static analysis report shows no high-severity findings, dependency scanning flags one outdated library that is already on the backlog, and the linter is satisfied. Two weeks after go-live, a customer reports that by changing a number in the URL of an invoice download, they can open invoices belonging to other companies. No tool raised it, because there was nothing wrong with the code that existed. The problem was the line that did not exist: a check that the invoice belonged to the logged-in user’s organisation.
That gap between “no bad patterns found” and “the code is secure” is what a secure code review exists to close. It is also why many companies buy reviews that disappoint. A review commissioned as “please look at all of our code” tends to produce a long list of low-value observations, while the authorization path that matters receives the same attention as a utility class. The value of a secure code review depends almost entirely on how it is scoped, who does it and what is expected at the end. This article explains what a security-focused review finds that scanners miss, where tools are still better than people, which code to review first, what regulations expect and how to commission an external review that pays for itself.
Why do scanners pass code that a reviewer would stop?
Static application security testing (SAST) tools work by matching code against known patterns of weakness. They trace data from a source, such as an HTTP parameter, to a sink, such as a SQL query or a shell command, and flag the path if no recognised sanitiser sits between them. They are very good at that job. They do it across millions of lines in minutes, they never get tired and they apply the same rule on the thousandth file as on the first.
What they cannot do is notice that something should be there and is not. An endpoint that returns a document without checking ownership contains no dangerous function call and no tainted data flow. From the tool’s point of view it is a clean method that reads an identifier, loads a record and returns it. Whether that is correct depends on a rule that lives in the business, not in the code: “users may only see documents of their own organisation”. A tool that does not know the rule cannot report its absence.
The same applies to logic that is technically sound and commercially wrong. A discount that can be applied twice, a refund that can exceed the original payment, an approval workflow in which the requester can also approve, a password reset token that remains valid after the password has changed. None of these match a vulnerability signature. Each of them is found by a person who understands what the application is supposed to do and reads the code asking whether it really enforces that.
This is not an argument against tools. It is an argument for being precise about what a green scan proves. A clean SAST report says your code contains no known bad patterns in the places the tool could analyse. It does not say your security controls are complete, and it says nothing about code paths the tool could not follow, such as reflection, dynamically built queries assembled across several classes, or framework conventions the rule set does not model.
What exactly is a secure code review, and what is it not?
A secure code review is a manual, security-focused examination of source code, supported by tools, with the aim of finding vulnerabilities and missing controls before they reach production. In the spirit of the OWASP Code Review Guide, it follows the application’s attack surface and trust boundaries rather than its file structure. The reviewer is not checking style, naming or test coverage. The reviewer is asking, for each piece of code that handles untrusted input or makes a trust decision, whether an attacker could make it behave in a way the business would not accept.
That makes it different from the code review most teams already do on every pull request. A peer review on a merge request is valuable and should include basic security questions, but it is optimised for the change at hand: is this diff correct, readable and consistent with the codebase? It rarely asks how this change interacts with the authorization model three layers away. A secure code review deliberately takes that wider view, usually over a defined part of the system rather than a single diff. Our guide on building a code review process covers the everyday peer review; this article is about the security-focused review that sits on top of it.
It is also different from a security audit of policies and processes. A secure code review produces findings tied to specific lines of code, with a reproduction path and a recommended fix. A finding such as “the organisation lacks a secure development policy” belongs in a governance assessment, not in a code review report.
Finally, it is not a guarantee. A review increases the probability that serious flaws are found before release, and it does so most efficiently in the areas where it is focused. Any vendor that promises a review will make your application “secure” is overselling. The honest promise is narrower and more useful: within an agreed scope, a qualified reviewer will find the classes of flaws that tools structurally miss, explain them and show how to fix them.
What does a security-focused reviewer find that SAST and dependency scanning miss?
The findings that justify a manual review fall into a small number of categories. They have one thing in common: each requires knowing what the code is supposed to do, not only what it does.
Missing or inconsistent access control. The invoice example above is the classic case, often called insecure direct object reference or, in APIs, broken object level authorization. Variants include checks that exist in the user interface but not in the API behind it, checks applied to the list endpoint but not to the export endpoint, and admin functions protected by a hidden URL rather than a role check. Our article on API security covers how these flaws look from the outside.
Business logic flaws. Race conditions in balance updates, workflows that can be completed out of order, quantity or price fields trusted from the client, coupon and referral mechanics that can be farmed. These are specific to each application and do not exist in any generic rule set.
Authentication and session weaknesses that are logically, not syntactically, wrong. Password reset tokens that do not expire or are not bound to the account, multi-factor authentication that can be skipped by calling the next step directly, session identifiers that survive logout or privilege change, “remember me” tokens stored in a reversible form.
Cryptography used correctly in syntax and incorrectly in design. A tool will flag MD5. It will not notice that a strong algorithm is used with a static initialisation vector, that a signature is verified but its result ignored in one branch, that tokens are encrypted when they should be signed, or that the application rolls its own scheme for something a standard library already solves.
Secrets and sensitive data in the wrong places. Scanners catch many hard-coded keys, but reviewers find the subtler cases: personal data written to logs, full card numbers kept in a debug table, tokens included in error messages returned to the client, configuration that switches off TLS verification “temporarily”. The article on secrets management in CI/CD covers the pipeline side.
Unsafe trust in internal components. Microservices that accept any request from inside the network, background jobs that process messages without validating them because “only our system writes to that queue”, file processing that trusts a content type sent by the uploader. These assumptions are invisible to a tool that analyses one service at a time.
Why is missing authorization the finding that matters most?
If a review could check only one thing, it should check authorization. The 2025 CWE Top 25, which MITRE derives from the weaknesses behind more than 39,000 CVE records published between June 2024 and June 2025, ranks Missing Authorization (CWE-862) fourth, up from ninth the year before. Cross-site scripting remains first, but cross-site scripting is precisely the kind of flaw automated tools and modern frameworks are getting better at preventing. Missing authorization is the kind they rarely can.
The reason is structural. Authorization is not a function call you either make or do not make in one place. It is a property of every path that reads or changes protected data, and it depends on rules that differ by object type, role, tenant and state. A web application with 150 endpoints may have 150 places where the check must be right. Frameworks help by offering decorators, policies and middleware, but they cannot know which of your endpoints need which policy, and the most common failure is not a broken check but a forgotten one.
A reviewer approaches this systematically. First they build an inventory of entry points: routes, API operations, message handlers, scheduled jobs. Then, for each entry point that touches protected data, they confirm three things: that the caller is authenticated, that the caller’s role allows the operation, and that the specific object belongs to the caller’s scope. The third check, object-level ownership, is where most findings appear, because it requires a query or a comparison that a developer focused on making the feature work can easily omit.
This is also where a review delivers the most value per day. An inventory of entry points with an authorization verdict for each is a concrete artefact the team can keep and maintain. It turns a vague worry, “are we sure everything is protected?”, into a table with a row per endpoint and an owner for every gap.
Where do automated tools still do better than people?
Being honest about the limits of manual review matters, because a review scoped to compete with tools wastes the reviewer’s time on work a machine does better.
Tools win on breadth. No reviewer can read two million lines of code with consistent attention, and no reviewer should try. SAST covers the whole codebase on every commit; a reviewer covers the parts that matter most, once or periodically.
Tools win on known patterns. SQL injection through string concatenation, use of deprecated cryptographic functions, unsafe deserialisation calls, missing output encoding in templates: these have well-defined signatures, and a good rule set finds them faster and more reliably than a person scanning by eye.
Tools win on third-party code. Software composition analysis compares your dependency tree with vulnerability databases and tells you within seconds that a transitive library has a published CVE. No reviewer should be reading open-source libraries line by line to find what the advisory database already knows.
Tools win on repetition. A rule written after one incident keeps protecting the codebase for years. A reviewer’s insight is lost unless it is turned into a rule, a test or a checklist item.
The practical conclusion is a division of labour. Automated checks run on every change and block the known patterns. Manual review is reserved for the places where the question is “is this control present and correct for our business?” A good external reviewer will start by reading your SAST and dependency scanning results, so that they do not spend paid days rediscovering what the tools already reported, and will turn their recurring findings into suggestions for new automated rules. If you are building that pipeline, our guide to DevSecOps without slowing delivery and the overview of software security testing types explain where each automated layer belongs.
Which parts of the codebase deserve a manual review first?
Reviewing everything with the same intensity is the most common way to waste a review budget. The alternative is a risk-based scope, agreed before the review starts, that concentrates attention on code where a flaw would be both likely and costly.
Start with trust boundaries. Any code where data crosses from a less trusted to a more trusted zone deserves attention: public API handlers, file upload and parsing, webhook receivers, integrations that accept data from partners, message consumers fed by external systems.
Next, authentication and authorization code: login, session management, password reset, multi-factor flows, token issuance and validation, role and permission checks, tenant isolation in multi-tenant systems. This is a small fraction of the codebase and a large fraction of the risk.
Then money and irreversible actions. Payment flows, refunds, balance changes, order placement, account deletion, data exports, administrative functions. Business logic flaws concentrate here because attackers concentrate here.
Then code that handles regulated or sensitive data: personal data under GDPR, card data under PCI DSS, health data, credentials. The question is not only “can it be stolen?” but “is it logged, cached, exported or retained where it should not be?”
Finally, code that changed recently or was written under pressure. New features shipped against a deadline, code generated with AI assistants and accepted with light review, modules inherited from a previous vendor. Git history is a useful scoping tool: files with high churn and many contributors carry more risk than stable, well-understood modules.
In most applications this risk-based scope covers a small part of the codebase. The rest is still covered, by automated checks and by the ordinary peer review on every pull request. The aim is not to ignore it, but to stop paying a specialist to read it.
How does a reviewer actually work through the code?
A competent secure code review follows a method that can be explained in advance. If a vendor cannot describe theirs, that is a warning sign.
It begins with context. The reviewer needs to know what the application does, who its users are, which roles exist, what data it holds and which threats worry you most. A one- or two-hour walkthrough with a developer who knows the system saves days of reverse engineering. Architecture diagrams, a list of entry points and the results of existing scans are all useful inputs.
Next comes a light threat model. The reviewer identifies the assets worth protecting, the actors who might attack them and the paths they would use. This does not need to be a formal exercise; its purpose is to turn “review the code” into a list of concrete questions, such as “can a user of tenant A read data of tenant B?” or “can a reseller grant themselves a discount above their limit?”
Then the reviewer traces data flows. For each high-risk entry point, they follow untrusted input from where it enters to every place it is used: queries, commands, file paths, templates, redirects, deserialisation, outgoing requests. At each step they check validation, encoding and the trust assumptions the code makes. In parallel, they trace trust decisions: where is the user identified, where is the role checked, where is ownership verified, and does every path pass through those points?
Throughout, a checklist keeps coverage honest. The OWASP Application Security Verification Standard, whose version 5.0 was released in May 2025, is a widely used reference. It groups requirements by area, such as authentication, session management, access control, validation and cryptography, and defines three verification levels. A review that states “we verified the in-scope components against ASVS level 2 requirements for authentication and access control” is more meaningful, and more comparable between vendors, than one that says “we reviewed the code thoroughly”. The OWASP Top 10 is useful for awareness but too coarse to serve as a review checklist on its own.
Finally, each candidate finding is confirmed. Good reviewers write a short proof, a request sequence, a unit test or a code trace, that shows the flaw is real and reachable. This step separates a useful report from a list of “potential issues” the team then has to triage itself.
Does AI-generated code change what a review has to look for?
It changes the volume and the shape of the risk more than the categories. Code produced with AI assistants contains the same classes of flaws as human code, but it arrives faster, in larger pieces, and often with a confident structure that makes it look more finished than it is.
The evidence that this matters is growing, though it should be read with care. Veracode’s 2025 GenAI Code Security Report tested more than a hundred language models on 80 coding tasks designed to expose common weaknesses and found that the generated code contained flaws matching OWASP Top 10 categories in about 45% of cases, with little improvement in security as models improved in syntax. Veracode sells code security tooling, so the study is a vendor’s own evaluation rather than independent research, and the exact figure should be read in that light. Our analysis of why 45% of AI-generated code contains vulnerabilities looks at the details.
For a reviewer, three patterns stand out. First, AI-generated code tends to be locally correct and globally unaware: a generated endpoint works, but it does not know about the authorization helper the rest of the codebase uses, so it either skips it or reimplements a weaker version. Second, generated code often pulls in dependencies the team did not deliberately choose, sometimes outdated, sometimes unnecessary. Third, generated tests tend to confirm the happy path the code was generated for, giving a false sense of coverage around exactly the edge cases where security flaws live.
The practical consequence is that teams relying heavily on AI assistants should move manual review earlier and make it more frequent for high-risk areas, rather than treating it as an annual event. Our article on the AI code audit in two weeks describes what such a focused review delivers.
When do regulations expect a secure code review?
Several frameworks either require or strongly expect a review of source code before release. Knowing which apply to you changes how you scope and document the review, because the report may become audit evidence.
PCI DSS. Requirement 6.2.3 of PCI DSS v4.0.1 requires bespoke and custom software to be reviewed before release to production or to customers, to identify and correct potential coding vulnerabilities. Requirement 6.2.3.1 adds conditions for manual reviews, including that they are performed by someone other than the author who is knowledgeable in code review techniques and secure coding practices. If your application is in scope for card data, a documented pre-release review is not optional.
DORA. For EU financial entities, the Digital Operational Resilience Act (Regulation (EU) 2022/2554) has applied since January 2025. Article 25 lists source code reviews, “where feasible”, among the appropriate tests a digital operational resilience testing programme may include. The regulatory technical standard on ICT risk management (Delegated Regulation (EU) 2024/1774) goes further in Article 16, referring to source code reviews covering both static and dynamic testing in the procedure for acquiring, developing and maintaining ICT systems. Financial entities and their software suppliers should assume reviews will be asked for and plan the evidence accordingly.
Cyber Resilience Act. The CRA requires products with digital elements to be made available on the market without known exploitable vulnerabilities, among other essential requirements in Annex I, with reporting obligations applying from September 2026 and most other obligations from December 2027. Code review is not named as the only acceptable method, but it is one of the most direct ways to demonstrate that vulnerabilities were looked for before release. Our article on Cyber Resilience Act obligations and deadlines covers the wider picture.
NIST SSDF. The Secure Software Development Framework (NIST SP 800-218) includes practice PW.7, “review and/or analyze human-readable code to identify vulnerabilities and verify compliance with security requirements”. It is not a law in the EU, but US public sector buyers reference it, and it is a useful, vendor-neutral description of good practice.
In all of these cases, the auditor will want to see more than a statement that a review happened. Keep the scope, the method, the reviewer’s qualifications, the findings and the evidence of remediation and retest. A review report designed from the start to serve as evidence costs little extra and saves a scramble before the audit.
Secure code review or penetration test: which do you need?
The two are often presented as alternatives. They are not; they look at the same system from opposite sides and find different things. Our article on penetration testing costs covers the external view in detail.
| Question | Secure code review | Penetration test |
|---|---|---|
| What is examined | Source code, configuration in the repository, dependencies | The running system as an attacker sees it |
| Strongest at finding | Missing authorization, logic flaws, crypto misuse, unsafe trust between components, issues on hard-to-reach paths | Exploitable chains, misconfiguration, infrastructure and deployment issues, what is actually reachable |
| Weaker at | Proving exploitability in the real environment, infrastructure flaws outside the code | Flaws on paths the tester cannot reach in the time available, explaining root cause in code |
| Output | Finding with file and line, root cause and code-level fix | Finding with reproduction steps and impact demonstration |
| Best timing | Before release of a significant change, after major refactoring, before an acquisition | Before go-live of the deployed system, periodically, after infrastructure changes |
| Typical access | Read access to repository, documentation, developer walkthrough | Test environment, test accounts, scope of targets |
If budget forces a choice, choose by question. If you want to know whether your controls are complete and correctly designed, a code review answers that better. If you want to know what an attacker can actually do to the deployed system today, a penetration test answers that better. For an application handling sensitive data or money, the sensible pattern is a focused code review of high-risk areas before a major release, followed by a penetration test of the deployed system, with the pentest scope informed by the review’s findings.
How do you commission an external secure code review?
Most disappointing reviews fail at the commissioning stage, not during the work. A clear brief protects both sides. The checklist below is what we recommend agreeing in writing before any review starts.
| Area | What to agree | Warning sign |
|---|---|---|
| Objective | The concrete questions the review must answer, such as tenant isolation, payment integrity or readiness for a PCI DSS assessment | ”Review the code for security issues” with no questions |
| Scope | Named repositories, modules or entry points, ranked by risk, and what is explicitly out of scope | Scope defined only as a number of lines or days |
| Reference standard | ASVS level and chapters, internal secure coding standard, regulatory requirement | No standard, or “OWASP Top 10” as the only reference |
| Inputs | Repository access, architecture overview, list of entry points, existing SAST and dependency results, a developer for a walkthrough | Reviewer refuses to look at existing scan results |
| Method | Threat-led tracing of data flows and trust decisions, tools used, how findings are confirmed | Method is “we run our scanner and review the output” |
| Reviewer profile | Named reviewers with application security and language experience, independence from the authors | Anonymous team, generic security profile without development background |
| Deliverables | Report with severity, location, proof, root cause and fix for each finding, plus an entry-point inventory with authorization verdicts | Report consisting mainly of tool output |
| Timeline | Onboarding, review window, interim call for critical findings, final debrief | Critical findings held back until the final report |
| Retest | Whether and when fixes are verified, at what price | No retest offered |
| Confidentiality | Handling of source code, NDA, where code is stored and when it is deleted | Code copied to unmanaged environments |
Two points deserve emphasis. First, insist on an interim channel for critical findings. If the reviewer finds a way to read all customers’ data on day two, you want to know on day two, not in a report two weeks later. Second, ask for the entry-point inventory as a deliverable. It is the artefact that keeps value after the review, because the team can maintain it and use it to scope the next review.
On budget, a focused review is measured in days, not months. As a reference point, ARDURA Consulting’s Code Health Audit takes one to two weeks and starts from €4,500; it includes a security review of code and dependencies alongside architecture and maintainability, and it says plainly that it does not replace a pentest of the live system. For transactions and investments, a technical due diligence adds team and process assessment and starts from €8,500. A review scoped to one application’s high-risk areas is usually planned in a similar number of days. If a quote for the same scope is several times higher, ask why: sometimes the vendor has found a good reason, and sometimes it is proposing to read everything.
What should the review report contain, and what happens after it?
A good report is short at the top and precise underneath. The opening page should tell a non-technical reader what was reviewed, against which standard, what the most serious findings are and what the overall risk picture looks like. Everything below is for the engineers who will fix the issues.
Each finding should state its severity with a stated rationale, the exact location in the code, a description of the flaw, a proof that it is real (a request, a test or a trace), the root cause and a recommended fix. Where the same root cause appears in many places, the report should say so and recommend a structural fix, such as a central authorization policy, instead of listing forty separate instances. Severity should reflect the business context: a missing authorization check on an endpoint that returns public product descriptions is not the same as one on an endpoint that returns salary data.
A useful report also lists what was checked and found to be sound. Knowing that session handling and password storage were reviewed and are well implemented is information too; it prevents the next reviewer from paying to check them again, and it gives auditors positive evidence rather than only a list of problems.
After the report comes the part many companies skip. Findings should go into the backlog with owners and target dates by severity. Critical issues are fixed before release, or the release waits. Recurring patterns should become automated rules, unit tests or items in the pull request template, so that the same flaw does not return in the next feature. The retest should confirm fixes, and its result should be kept with the original report as evidence. If you rely on external specialists to absorb the remediation work, our software testing services can add security-aware QA engineers to the team for the fix-and-verify cycle.
Finally, schedule the next review by trigger, not only by calendar. A major new feature touching payments, a change of authentication provider, a large block of AI-generated code, a new tenant model or a pending acquisition are all better triggers than “it has been a year”.
What are the key takeaways?
A secure code review is worth paying for when it does what tools cannot: confirm that the security controls your business needs are present and correct on every path that matters. A clean scan proves the absence of known bad patterns; it does not prove the presence of an authorization check, a correct workflow or a sound cryptographic design.
Five points to keep. First, scope the review by threats and trust boundaries, not by lines of code; a small part of the codebase usually carries most of the risk. Second, put authorization first: missing authorization ranks fourth on the 2025 CWE Top 25 because it is the flaw tools structurally miss, and an inventory of entry points with a verdict for each is the most durable output of any review. Third, keep tools and people in their lanes: automated checks on every change for known patterns, manual review for high-risk code and logic. Fourth, if you are subject to PCI DSS, DORA or the Cyber Resilience Act, design the report as audit evidence from the start. Fifth, treat code review and penetration testing as complementary, not alternative.
If you want an independent view of your code before a major release, an audit or an acquisition, ARDURA Consulting’s Code Health Audit covers code and dependency security in one to two weeks, and our software testing services can follow up with penetration testing and security-aware QA engineers from a network of more than 500 specialists, with first profiles typically within 12–72 hours. Contact us to agree a scope that answers your questions rather than counts your lines.