Skip to content

Secure Code Review Checklist

Cyber Security6 min read

A practical secure code review checklist covering input handling, authentication, authorisation, secrets, data protection, logging and dependencies.

In this article
  1. How to use a checklist without slowing the team
  2. The checklist
  3. Which checks to automate
  4. Common mistakes in code review
  5. Making the checklist stick
  6. What to do next

A secure code review checklist is a short list of questions a reviewer asks about every change: can untrusted input reach something dangerous, is access checked on the server, are secrets and personal data handled safely, and are errors and logs free of leaks. Using the same checklist on every pull request catches the common, costly mistakes that tests and linters miss, and it gives junior developers a shared standard to learn from.

How to use a checklist without slowing the team

Security review should not be a separate gate that adds a week. Fold it into the code review you already do. A few habits help:

  • Keep pull requests small. Reviewers find far more in a hundred changed lines than in two thousand.
  • Ask the author to describe in the pull request what data the change touches and who can call it.
  • Spend more time on risky areas: authentication, authorisation, payments, file uploads, anything parsing external input and anything touching personal data.
  • Let automation take the boring checks, so humans focus on logic. More on that below.

The checklist is a prompt for thinking, not a box ticking exercise. Reference material such as the OWASP Top 10, the OWASP Application Security Verification Standard and the OWASP Cheat Sheet Series provide the detail behind each point.

The checklist

1. Input handling and injection

  • Is every external input validated on the server for type, length, format and range? Client-side checks are for convenience only.
  • Are database queries parameterised? Look for string concatenation in SQL, NoSQL filters, LDAP and operating system commands.
  • Is output encoded for its context (HTML, attribute, URL, JavaScript) to prevent cross-site scripting?
  • Are file uploads restricted by type and size, stored outside the web root, renamed and scanned where appropriate?
  • Are URLs fetched on behalf of a user checked, to avoid server-side request forgery?
  • Is deserialisation of untrusted data avoided or restricted to safe formats?

2. Authentication and session handling

  • Are passwords hashed with a modern, slow algorithm such as Argon2id, bcrypt or scrypt, never stored in plain text or with a fast hash?
  • Is there rate limiting or lockout on login, password reset and one-time code endpoints?
  • Are session tokens random, expired on logout, rotated after login and sent in cookies with Secure, HttpOnly and SameSite attributes?
  • Does password reset avoid revealing whether an account exists?

Our article on building a secure login system goes into these in depth.

3. Authorisation

  • Is access checked on the server for every request, not just hidden in the interface?
  • Does the code verify that this user owns or may access this specific record? Broken object level authorisation, where changing an identifier in a request exposes someone else's data, is one of the most common API flaws.
  • Are administrative functions protected separately and tested with a normal account?
  • Does the default, when no rule matches, deny access?

4. Secrets and configuration

  • Are there any keys, tokens, passwords or connection strings in the code, tests, sample files or commit history?
  • Are secrets loaded from a secrets manager or environment, and rotatable? See CI/CD secrets management basics.
  • Are debug modes, verbose errors and default credentials disabled in production configuration?

5. Data protection and privacy

  • Does the change collect or log personal data that is not needed? Data minimisation is a GDPR principle.
  • Is sensitive data encrypted in transit with TLS and, where appropriate, at rest?
  • Are retention and deletion handled, so data does not live forever by accident? Our article on GDPR, logging and retention explains the trade-offs.
  • Can the data be found and exported or deleted when a person exercises their rights? See handling data subject requests in business software.

6. Error handling and logging

  • Do error messages avoid stack traces, query text and internal paths?
  • Do failures fail closed, denying access rather than allowing it?
  • Are security events logged (failed logins, permission denials, administrative actions) without logging passwords, tokens or full card or health data?
  • Is user input sanitised before logging, to prevent log forging?

7. Dependencies and supply chain

  • Are new libraries necessary, maintained and from a trusted source? Does the version pin and lockfile change look intentional?
  • Do dependency scans show known vulnerabilities in what was added or updated?
  • Does the licence suit your use? See open source licence compliance.

8. Logic, concurrency and business rules

  • Can a user skip a step in a workflow, replay a request or apply a discount twice?
  • Are there race conditions where two simultaneous requests could overspend a balance or double book a resource?
  • Are limits and quotas enforced server-side?

9. APIs and infrastructure code

  • Does the API return only the fields the caller needs, avoiding mass assignment and excessive data exposure? Related reading: REST versus GraphQL.
  • Are CORS rules, security headers and content security policy deliberate rather than wildcards?
  • In Terraform, Docker or pipeline files, are permissions least privilege and are storage and databases private by default?

Which checks to automate

People are best at spotting flawed logic and missing authorisation. Machines are best at repetitive pattern checks. A reasonable split looks like this:

CheckBest done byTypical tool type
Known vulnerable dependenciesAutomation on every buildDependency scanner
Secrets committed to the repositoryAutomation, ideally before commitSecret scanner
Common insecure patternsAutomation with human triageStatic analysis
Missing authorisation, broken logicHuman reviewerChecklist and threat thinking
Design level flawsHuman, earlier than code reviewThreat modelling

Wire the automated checks into your pipeline, as described in our GitHub Actions CI/CD guide, so that results appear on the pull request itself. Tune the rules to keep false positives low, or developers will ignore them.

Common mistakes in code review

  • Reviewing only the diff. A safe looking change can be dangerous in context. Check callers and where the data comes from.
  • Trusting the framework blindly. Frameworks help, but raw queries, disabled protections and custom parsing bypass them.
  • Treating internal endpoints as safe. Internal services get reached by attackers who are already inside. Apply the same checks.
  • Not testing the fix. When a review finds an issue, add a test that fails without the fix.
  • No feedback loop. If the same issue appears repeatedly, add it to the checklist, a lint rule or team training.

Making the checklist stick

A checklist only helps if people use it. Keep it to one page, put it in the pull request template and let reviewers skip sections that do not apply. Once a quarter, look at the issues that escaped to production or were caught late, and ask which checklist line would have caught them. Add it, or remove lines that never find anything. Pair a newer developer with an experienced reviewer for a few reviews so that the reasoning behind each item is explained, not only the item itself.

What to do next

  1. Copy the sections above into your pull request template and trim to what applies to your stack.
  2. Turn on dependency and secret scanning in your repository.
  3. Pick the riskiest module and review it against the checklist as a team exercise.
  4. Add one security focused test for each issue found.

Review catches problems in code, while vulnerability management and a penetration test catch what reaches running systems. If you would like help with this, the CloudWiss team in Dublin can talk it through, including reviewing a critical module or setting up pipeline checks. See our cyber security services for details.

Share this article

General educational information, not legal or professional advice for your specific situation.

Frequently asked questions

How long should a secure code review take?

It depends on the size and risk of the change. Small pull requests can usually be checked against the list in minutes, while a new authentication feature deserves a dedicated session. Keeping changes small is the best way to keep reviews quick and effective.

Is automated scanning enough without a human review?

No. Scanners find known patterns and vulnerable dependencies well, but they struggle with business logic and missing authorisation checks. A human reviewer who understands what the code should allow catches those. The two approaches work best together.

Who should perform secure code reviews if we have a small team?

Peers can do it if they use a shared checklist and have some basic secure coding training. Rotate reviewers so knowledge spreads, and involve someone with security experience for high risk changes. Some teams bring in an external reviewer for critical modules.

Which standards can I use for reference?

The OWASP Top 10, the OWASP Application Security Verification Standard and the OWASP Cheat Sheet Series are widely used starting points. Your language and framework documentation also has security guidance. Pick one baseline and adapt it, rather than trying to follow everything at once.

Keep reading

Let’s build it

Ready to build with CloudWiss?

Tell us what you want to build, move to the cloud or keep running. We reply with a clear next step.