Skip to main content
Published in Engineering Insights

Code Audit Checklist: What a Codebase Audit Should Include

Code Audit Checklist: What a Codebase Audit Should Include
Table of contents
  1. What is a code audit, and how is it different from a code review?
    1. When should you get a code audit?
  2. The code audit checklist
  3. What is the code audit process, step by step?
    1. Step 1: Preparation and scope
    2. Step 2: Automated scans and static analysis
    3. Step 3: A manual security audit of the code
  4. How should a code audit check security?
    1. Access controls and authentication
    2. Input validation, SQL injection and cross site scripting
    3. Error handling
  5. What should a code audit find in configuration files and dependencies?
    1. Dependencies, known vulnerabilities and the supply chain
  6. What can automated tools find, and what needs a person?
  7. How do you judge the tests and the release pipeline?
  8. How does a code audit put technical debt and code quality in business terms?
  9. Should the audit explain what the code actually does?
  10. When do accessibility and compliance issues belong in the audit?
  11. What should the code audit report contain?
  12. What did an audit find at the AARP Foundation?
  13. Can a code audit come back saying the code is fine?
    1. Code audit cost and what to hand over

A codebase audit should tell you, in writing, what is broken in your software, what is risky, and what to fix first. This checklist is for a COO or CEO who suspects the system the business runs on is in worse shape than the team says. It lists the security, dependency, test, pipeline, technical debt and business rule checks to ask for, and the report to expect. The audit is the proof behind a choice to keep the system, fix it or rebuild it.

The Gnar Company runs free source code audits. Its codebase audits page says: "No fee, and it can come back saying your codebase is in reasonable shape".

Each item below names the public source behind it, so your own engineers can check the report. Most of the security items come from OWASP. OWASP calls itself "a nonprofit foundation improving software security".

What is a code audit, and how is it different from a code review?#

A code audit is an outside read of the code your business runs on, and it ends in a verdict. As general advice, an audit looks at the codebase as a whole, and the code review on each pull request checks one change.

Gnar's codebase audits page puts it this way: "A source code audit is an outside check of the code behind your business software. It tells you what is broken, what is risky, and what to do about it".

OWASP's Secure Code Review Cheat Sheet describes two kinds of review. Baseline reviews "examine the entire codebase comprehensively". Diff-based reviews "focus on code changes only". Pull requests and commits are its examples.

A full audit is the baseline kind. The code review your developers run on each pull request is the diff-based kind. You want both.

When should you get a code audit?#

OWASP's cheat sheet says a full review of the codebase fits new applications and major releases, legacy system onboarding, compliance requirements and post-incident analysis. Gnar's codebase audits page has a card for a team's own code, and it starts: "You suspect something is wrong and cannot prove it".

The code audit checklist#

A code audit should cover scope, security flaws, access controls, user input, error handling, secrets and dependencies. It should also cover tests, the release pipeline, technical debt, architecture, business rules, accessibility where it applies, and a recommendation. The table gives each item, what the report should show, and the public page it comes from.

Item What the report should show Where it comes from
Scope Which files and components were reviewed. OWASP report template.
Security flaws Each finding checked against the OWASP Top 10, with a severity. OWASP Top 10:2025.
Access controls Whether users can act outside their permissions. OWASP A01:2025.
User input Input validation, SQL injection and cross site scripting checks. OWASP cheat sheet and attack pages.
Error handling Whether errors give away details about the system. OWASP error handling cheat sheet.
Secrets API keys and passwords found in code or configuration files. OWASP secrets cheat sheet.
Dependencies The outside libraries in use, their versions and any known security flaws. OWASP A03:2025 and CISA.
Tests Which parts of the code have tests and which have none. Martin Fowler, Test Coverage.
Release pipeline Whether an automated build, with tests, checks each merge. Martin Fowler, Continuous Integration.
Technical debt Where changes are hard, and why. Martin Fowler, Technical Debt.
Architecture How the code is put together and connects to other systems. Gnar codebase audits page.
Business rules What the main parts of the code do. Gnar codebase audits page.
Accessibility WCAG checks, where the public uses the software. ADA.gov guidance.
Recommendation Keep it, fix it or rebuild it, with next steps. Gnar codebase audits page.

What is the code audit process, step by step?#

A code audit process runs in four steps: preparation, automated scans, a manual security audit of the code, and a written report. As general advice, that order follows OWASP's Secure Code Review Cheat Sheet. The cheat sheet has a preparation list, advice to run tools before the manual review, baseline review steps and report templates.

Step 1: Preparation and scope#

The auditor first learns what the system is for. OWASP's preparation list starts with "Understand application architecture and business requirements". It also says to "Gather threat models and previous security findings", to "Review security requirements and documentation" and to "Identify critical assets and high-risk functions". The agreed scope goes into the report, so you can see later which code was read.

Step 2: Automated scans and static analysis#

Tools run next. The cheat sheet says to "Run automated tools before manual review to identify obvious issues". It also says to "Apply human judgment to validate automated findings". OWASP's DevSecOps Guideline describes static analysis as "usually part of a Code Review (white-box testing)". It calls it "a method of computer program debugging that is done by examining the code without executing the program".

OWASP's page on source code analysis tools lists SonarQube, Checkmarx and Veracode Static Analysis among many others. Its Checkmarx entry says it can "Run full or incremental source code security scans".

Performance is a separate test. Apache JMeter, for example, is "designed to load test functional behavior and measure performance", says its project page. As general advice, a code read can point to likely performance issues, and a load test checks them.

Step 3: A manual security audit of the code#

People then review what the tools miss. OWASP's baseline review steps include "Architecture review for security anti-patterns", "Data flow tracing", "Cryptographic implementation review" and "Configuration and deployment review". Its manual techniques include "Code Path Tracing", which it describes as "Following execution paths through complex business logic".

The fourth step, the written report, has its own section below.

How should a code audit check security?#

A security audit inside a code audit should test the code against a public list of risks. It should give each finding a severity. The usual list is the OWASP Top 10. OWASP calls it "a standard awareness document for developers and web application security". It says the list represents "a broad consensus about the most critical security risks to web applications".

The 2025 edition names ten risks. The first five are broken access control, security misconfiguration, software supply chain failures, cryptographic failures and injection. The next five are insecure design, authentication failures, software or data integrity failures, security logging and alerting failures, and mishandling of exceptional conditions.

Access controls and authentication#

Broken access control is first on the 2025 list. OWASP's A01:2025 page says "Access control enforces policy such that users cannot act outside of their intended permissions".

The cheat sheet tells reviewers to "Examine authorization checks, role-based access controls, and privilege escalation prevention". It also says to "Review authentication mechanisms".

Input validation, SQL injection and cross site scripting#

OWASP's baseline review steps include "Entry point analysis and input validation". Its Input Validation Cheat Sheet says "Input validation checks whether data meets an application's requirements before the application uses it".

Two classic flaws come from weak handling of user input. The first is SQL injection. OWASP's SQL injection page says "A successful SQL injection exploit can read sensitive data from the database, modify database data". It says to "consider SQL Injection a high impact severity". The second is cross site scripting (XSS). OWASP's XSS page says those flaws occur where a web app uses input from a user in its output "without validating or encoding it". It says "XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user".

Error handling#

An audit should check what the software shows people when something goes wrong. OWASP's Error Handling Cheat Sheet says an attack begins with the attacker gathering facts, such as the names and versions of the server and libraries. It warns that "Unhandled errors can assist an attacker in this initial phase".

What should a code audit find in configuration files and dependencies?#

A code audit should list any secrets sitting in code or configuration files. It should also list the outside libraries the software depends on, with their known vulnerabilities. OWASP's Secrets Management Cheat Sheet names the first problem. It says many organizations have secrets such as API keys and database passwords "hardcoded within the source code in plaintext". The code review cheat sheet asks for "No hardcoded secrets, proper secret storage and rotation".

Dependencies, known vulnerabilities and the supply chain#

A03 on the 2025 list is Software Supply Chain Failures. OWASP says these failures "are often caused by vulnerabilities or malicious changes in third-party code, tools, or other dependencies that the system relies on". Those external dependencies are code your team did not write. The A03 page says you are likely at risk if "you do not carefully track the versions of all components that you use". That includes "nested (transitive) dependencies," the libraries your libraries pull in. The page also flags software that is "vulnerable, unsupported, or out of date".

The page's fix list starts with an inventory. It says to "Centrally generate and manage the Software Bill of Materials (SBOM) of your entire software". CISA defines it in one line: "An SBOM is a nested inventory, a list of ingredients that make up software components".

For JavaScript projects, npm has a separate command, npm audit. The npm docs say it sends a description of your project's dependencies to the registry "and asks for a report of known vulnerabilities". The docs also note that "some vulnerabilities cannot be fixed automatically and will require manual intervention or review".

The A03 page also reads: "No single person should be able to write code and promote it all the way to production without oversight from another human being". The audit should say whether one person can do that today.

What can automated tools find, and what needs a person?#

Automated tools can scan a whole codebase and catch some well-known flaws. People have to review the rest. OWASP's page on source code analysis tools says the tools "can help analyze source code or compiled versions of code to help find security flaws".

The page lists their strengths. They scale well. It says they identify "certain well-known vulnerabilities", such as SQL injection flaws. The page also lists weaknesses, including these three:

  • Searches for many types of flaws are hard to automate. The page names "Authentication problems," "Access control issues" and "Insecure use of cryptography".
  • They give "High numbers of false positives".
  • They are "Frequently unable to find configuration issues, since they are not represented in the code".

The code review cheat sheet says manual review aims "to identify security vulnerabilities that automated tools often miss". Its list of areas for human review includes "Security issues that depend on application-specific business rules".

Code quality tools sit next to the security scanners. ESLint, for example, "is a configurable JavaScript linter". Its docs say "It helps you find and fix problems in your JavaScript code".

Gnar's audit uses people and a tool. Its page says "Senior engineers read it, and Gnar’s own AI tool checks it too". As general advice, ask any code audit service about its methods. Which automated tools ran? Which parts of the code did a person read?

How do you judge the tests and the release pipeline?#

Judge the tests by which parts of the code they leave untested. Judge the pipeline by whether an automated build runs those tests on each merge. Martin Fowler's note on test coverage makes the first point: "Test coverage is a useful tool for finding untested parts of a codebase".

In the same note he says coverage "is of little use as a numeric statement of how good your tests are". He gives one warning sign: "Certainly low coverage numbers, say below half, are a sign of trouble".

His test for enough testing is two lines an executive can ask about:

  • "You rarely get bugs that escape into production"
  • "You are rarely hesitant to change some code for fear it will cause production bugs".

A useful audit names the untested parts of the code. A coverage percentage alone says little.

For the pipeline, Fowler's article on Continuous Integration says each integration, a merge of one developer's changes with other developers' changes, "is verified by an automated build (including test)". He adds that "Self-testing code is so important to Continuous Integration that it is a necessary prerequisite". The audit should say whether that pipeline exists and runs the tests.

How does a code audit put technical debt and code quality in business terms?#

A good audit explains technical debt as the extra effort future changes will take. Martin Fowler calls the cause cruft: "deficiencies in internal quality that make it harder than it would ideally be to modify and extend the system further". In his piece on technical debt, the extra effort it takes to add something new is the interest paid on that debt.

Gnar's audit page puts it in one phrase. Technical debt is "old shortcuts that make every change harder".

As general advice, code quality belongs in this part of the report. Naming, structure, repeated code, coding standards and code readability decide how much a new developer has to learn before a safe change.

The First Line Technology case shows what debt looks like from the business side. The case study says the app's team "lived with the constant threat that making even a small change could break another feature". Gnar's codebase audits page says its code audit found that "a new front end on the existing WordPress back end would cost less than repairing the old one".

Should the audit explain what the code actually does?#

Yes, the audit should explain what the main parts of the code do, most of all where nobody wrote it down. Gnar's page lists this among the things you get back: "Where nobody wrote down how it works, we explain what the main parts do".

Its FAQ gives the kind of rule it means. Senior engineers "work out the main business rules nobody wrote down, like how an order gets priced".

The audit should also cover how the code connects to the systems around it. A Gnar code audit "checks the code, how it is put together, and how it connects to your other systems". OWASP's cheat sheet asks baseline reviewers to "Map complete application boundaries and dependencies".

Gnar's guide to using Claude Code on a legacy system says: "A code audit is the better next step when nobody inside can check what Claude Code hands back, or when the decision in front of you is whether to keep, fix or rebuild".

When do accessibility and compliance issues belong in the audit?#

As general advice, accessibility belongs in the audit where the public uses the software. Compliance checks belong when a rule such as the Payment Card Industry Data Security Standard (PCI DSS) covers the data it handles.

The Justice Department's 2022 guidance on web accessibility says the Americans with Disabilities Act (ADA) "applies to state and local governments (Title II) and businesses that are open to the public (Title III)". It says existing technical standards "provide helpful guidance". It names "the Web Content Accessibility Guidelines (WCAG) and the Section 508 Standards". The page also notes that it does not reflect the rules for state and local governments published on April 24, 2024.

Payment card data has its own standard. The PCI Security Standards Council says "PCI DSS provides a baseline of technical and operational requirements designed to protect payment account data".

Tell the auditor which rules apply before the work starts. OWASP lists "Compliance requirements" among the reasons for a full baseline review.

What should the code audit report contain?#

The report should rank findings by severity and say where each one is and what it means. It should recommend a fix for each and end with an overall call. OWASP's cheat sheet gives a finding template. It has a severity of "[Critical/High/Medium/Low]", a location, the impact, a recommendation and a status. Its summary template adds the scope, a count at each severity and an "Overall Risk Assessment".

Gnar's page lists what its audit hands back:

  • The risks, worst first.
  • Quick fixes to start on: "Small fixes your team can make now, kept separate from the big decisions".
  • What the code really does.
  • Keep it, fix it, or rebuild it: "Your options, and the next steps for each one".

The last step on Gnar's page describes the handover: "A written audit, worst problems first, with what to do about each one. We walk your leaders and your engineers through it".

The status field in OWASP's template reads "[Open/In Progress/Fixed/Accepted Risk]". It gives you a way to check later that each problem was fixed or knowingly accepted. As general advice, schedule a follow-up read against the same list.

What did an audit find at the AARP Foundation?#

Gnar's audit of the AARP Foundation's Property Tax-Aide tools found six problems, from no integrated testing and security vulnerabilities to interfaces that did not meet ADA accessibility requirements. The audit also made the replatforming call. The tools first went live in 2019, built by another development partner. Two years later the program's team was worried about quality and scalability and brought Gnar in. The case study calls this step "a diagnosis before a prescription".

As general advice, here is where each of its findings sits on this checklist:

What the audit found Where it sits on this checklist
No integrated testing Tests
Security vulnerabilities Security flaws
No CI/CD (automated build and release) pipeline Release pipeline
Inconsistent frontend components Technical debt
Unnecessary UX complexity User experience, beyond the code
Interfaces that did not meet ADA accessibility requirements Accessibility

The case study states the result: "The audit made the call clear: replatforming would cost less and carry less risk than rebuilding on top of the existing codebase". The work rebuilt 14 tools on React and Ruby on Rails. The case study credits a redesigned UX with 40% fewer clicks to complete an application, on average.

An audit can point other ways too. At First Line Technology, the audit led to a new front end on the existing back end.

Gnar's guide to replatforming, refactoring or rebuilding says: "Before you choose, get the code audited and ask how the old system keeps running while each new part takes over".

Can a code audit come back saying the code is fine?#

Yes, a code audit can come back saying the code is fine. Gnar's answer to a buyer who says "I have been sold this before" is: "So has everyone. The audit can come back saying your code is fine, and we will say so".

Code audit cost and what to hand over#

Gnar does not charge for its code audit. Its FAQ explains why: "Because The Gnar Company reads existing code before it takes on any project. It does not charge for that".

Gnar's FAQ lists what it needs to start: "Two things: a signed non-disclosure agreement and access to the code. The Gnar Company signs the agreement first. After that, anyone who holds the code, such as a contractor or a past vendor, can share access. Your team can also tell Gnar where to look first".

As general advice, the auditor also needs context from you. Hand over what you have: any existing documentation, a short note on what the system does, the known problems, past incidents and any deadline.

Frequently asked questions

What should a codebase audit include?

A codebase audit should include its agreed scope, security flaws checked against the OWASP Top 10, access controls, user input, error handling, secrets and dependencies. It should also cover tests, the release pipeline, technical debt, architecture, business rules, accessibility where the public uses the software, and a keep, fix or rebuild call.

What is the difference between a code audit and a code review?

As general advice, a full code audit looks at the codebase as a whole, and the code review on each pull request checks one change. OWASP's Secure Code Review Cheat Sheet names the two review types. Baseline reviews "examine the entire codebase comprehensively". Diff-based reviews "focus on code changes only", such as pull requests and commits.

Can automated tools do a code audit on their own?

No. OWASP's page on source code analysis tools says they scale well and find certain well-known flaws, such as SQL injection. It also says searches for many types of flaws are hard to automate, including access control issues and authentication problems. And it lists high numbers of false positives.

What skills does a code auditor need?

As general advice, look for engineers who have built and run systems like yours, and who can explain each finding to your own team in plain words. OWASP's Secure Code Review Cheat Sheet says manual review relies on human judgment and domain expertise.

Does The Gnar Company offer a free code audit?

Yes. The Gnar Company’s code audit is free. Gnar signs a non-disclosure agreement before it sees any code. Then senior engineers read it and send back what they found, worst problems first. You decide what to do next, with Gnar or without.

Do we have to hire Gnar after the audit?

No. The Gnar Company’s code audit does not commit you to anything. If your own engineers can make the fixes, the audit says so. If you want help with the rest, Gnar can do that too.

Is a high test coverage number proof of good tests?

No. Martin Fowler writes that high coverage numbers are too easy to reach with low quality testing. He says coverage is of little use as a number for how good tests are. He also writes that low coverage numbers, say below half, are a sign of trouble.

Stay In The Loop

Never miss an update. Get the latest blogs, webinars, and expert insights straight to your inbox from The Gnar.