Skip to main content
Published in Engineering Insights

Technical Due Diligence: Auditing Code Before You Buy

Technical Due Diligence: Auditing Code Before You Buy
Table of contents
  1. What is technical due diligence?
    1. How is it different from financial due diligence?
    2. When in the due diligence process does it happen?
  2. What does a technical due diligence checklist cover?
  3. Is the code in the shape the seller says it is?
  4. Who owns the code the target company sells?
  5. Which open source licenses come with the software?
  6. How exposed is the software to known security risks?
    1. What about data privacy and sensitive data?
  7. Can the engineering team carry the product after close?
  8. Will the target's software connect to your systems?
  9. What are the red flags in technical due diligence?
  10. What do you do with the technical findings?
  11. Should you use your own team or technology due diligence consulting?
    1. What should you ask a diligence consultant before hiring one?
  12. Where Gnar's free code audit fits

Technical due diligence is the review of a target company's technology before you buy it. It is also called technology due diligence. It covers the code and who owns it. It also covers the licenses, the security, the engineering team and how the software will connect to your systems. This checklist is for the CEO of a mid-market company buying a smaller competitor that runs on its own software. It also explains what technology due diligence consulting covers. Then you can decide whether to hire it or use your own engineers.

The findings change three things about the investment. They change the price, the terms of the purchase agreement and the plan for after close. A seller's description of its software is a claim. The technology due diligence process checks that claim against the code. This post quotes primary sources for the rules (the license texts, the U.S. Copyright Office, CISA, NIST and the Linux Foundation) and labels general engineering advice as such.

One part of tech due diligence is reading the code itself. The Gnar Company runs a free source code audit on code a company already has. Gnar's code audit page describes it this way: "At The Gnar Company, senior engineers in the U.S. read the code, with help from an AI tool Gnar built, and explain what they find." The same page makes the offer plain: "Ask for the code audit. No fee, and it can come back saying your codebase is in reasonable shape."

What is technical due diligence?#

Technical due diligence is a review of the target company's technology assets before the deal is signed. Those assets are its software, code, security, licenses and engineering team. As general advice, tech due diligence answers three questions a financial review cannot. Does the software work as described? Who owns it? What will it cost to keep, fix or connect after close?

Buyers often shorten it to tech due diligence. Tech due diligence matters most when the target's revenue depends on software its own team built. At close, you take on that software, along with its technical debt, its licenses, its security gaps and its other technical risks.

How is it different from financial due diligence?#

As general advice, financial due diligence tests the numbers the seller reports, such as revenue, margins and debts. Technology due diligence tests the software those numbers depend on. As general advice, the two reviews meet in three places. The first is technology costs that recur, such as hosting and software licenses. The second is the cost to fix what the technical review finds. The third is the cost to connect the target's systems to yours after close.

When in the due diligence process does it happen?#

As general advice, technical due diligence starts once the seller agrees to share its code under a non-disclosure agreement (NDA). It should finish before the price and the purchase agreement are final. Findings that arrive after signing have fewer ways to change the deal. Many end up in the plan for after close.

What does a technical due diligence checklist cover?#

A technical due diligence checklist covers eleven key areas of the target company's technology. They are code quality and tests, software architecture, technical debt, code ownership, open source licenses, security, data privacy, cloud infrastructure and costs, the engineering team, the product roadmap, and integration with your systems. The table lists what to ask the seller for in each area and where the rule or advice comes from.

Area Ask the seller for Basis
Code quality and tests Read access to every repository, the test suite and any technical documentation Gnar's audit page, general advice
Software architecture A walkthrough of the technology stack, the main parts and their system dependencies General advice
Technical debt The team's own list of shortcuts and parts that are hard to change Gnar's audit page (what technical debt is), general advice
Code ownership The agreements signed by every employee and contractor who wrote code U.S. Copyright Office, Circular 30
Open source licenses A software bill of materials (SBOM) CISA, the GNU license texts
Security Recent security test results and the fixes made since CISA KEV catalog, NIST CSF 2.0
Data privacy A list of the sensitive data the software stores, the privacy policy and the data protection controls NIST CSF 2.0 (IDENTIFY), general advice
Cloud infrastructure and costs Hosting bills and contracts for outside services General advice
Engineering team Who knows each critical system, and how code is reviewed and released NIST SSDF, general advice
Product roadmap The product roadmap, and what each planned change needs from the code General advice
Integration Every system the software exchanges data with Gnar's audit page, general advice

As general advice, put each tech due diligence request in writing and keep a list of what arrived. A diligence assessment should also say which areas it could not check.

Is the code in the shape the seller says it is?#

You find out by having engineers read the code and run its tests. As general advice, base each code quality finding on the repository and the test results. Slides and demos are the seller's description of the software. As general advice, also read the seller's product roadmap next to the code. If some planned work needs a rebuild first, that cost may not be in the roadmap.

Gnar's audit page names what a code read looks for: "They look for security holes, missing tests and technical debt (old shortcuts that make every change harder)." The page also ranks what it finds: "Security holes, code that breaks when anyone changes it, and parts likely to slow down as you grow."

The AARP Foundation case study shows what a read of inherited code can turn up. The foundation's Property Tax-Aide tools were built by an earlier firm: "The tools launched in 2019 with a different development partner." The case study says the foundation's team "engaged The Gnar to assess the current state." The findings it lists include "no integrated testing" and "security vulnerabilities." It then says: "The audit made the call clear: replatforming would cost less and carry less risk than rebuilding on top of the existing codebase."

That case was a change of software vendor. It shows the kind of findings a code read produces. A code read can also favor keeping what exists. On the audit page, Gnar describes the result at First Line Technology: "Gnar’s code audit found that a new front end on the existing WordPress back end would cost less than repairing the old one."

Gnar's Fitbit case study covers code that changed hands in a purchase: "Fitbit had acquired a health coaching platform company". Gnar's work came after that purchase. In the case study's words: "We performed detailed code audits and collaborated with the internal team to solve problems as they arose, and we became proficient on the existing system codebase."

Who owns the code the target company sells?#

Ownership of the code depends on who wrote it and what they signed. The U.S. Copyright Office's Circular 30 says a work is "made for hire" in two situations. The first is "When it is created by an employee as part of the employee’s regular duties." The second is "When a certain type of work is created as a result of an express written agreement between the creator and a party specially ordering or commissioning it."

The circular sets the default: "Ordinarily, the author is the person or persons who actually created the work you intend to register." A work made for hire is the exception. The circular explains what that status means: "When a work is a made for hire, the hiring or commissioning party is considered the author and the copyright owner." For a commissioned work, it lists four criteria. The work must fall within one of nine listed categories. There must be a written agreement. The parties must expressly agree the work is made for hire. The agreement "must be signed by all parties." The circular then states: "If a work fails to satisfy any of these requirements, it is not a work made for hire."

As general advice, ask for the agreement behind every contractor, agency and former employee who wrote code. A work made for hire clause only counts for commissioned code that fits one of the nine categories. So have counsel also look for a written assignment of the copyright in each one. Add any code a founder wrote before the company was formed. Ownership is the intellectual property question inside technology due diligence.

Which open source licenses come with the software?#

Open source components arrive with licenses that can decide whether a company must share its own source code. Start with an inventory of the components, then read the licenses that carry conditions.

CISA describes a software bill of materials as "a nested inventory, a list of ingredients that make up software components." As general advice, ask the seller for one, or have the reviewer build one from the code.

The GNU General Public License (GPL) has a published FAQ with an entry for web software. It asks about a company running a modified GPL program on its web site. The answer: "The GPL permits anyone to make a modified version and use it without ever distributing it to others. What this company is doing is a special case of that. Therefore, the company does not have to release the modified sources."

The same answer adds a limit: "The situation is different when the modified program is licensed under the terms of the GNU Affero GPL." Section 13 of the GNU Affero GPL (AGPL) says a modified version "must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version." The GPL FAQ adds a second limit. When a web site sends separate GPL programs to visitors, "often written in JavaScript," the source code for those programs "must be released to the user under the terms of the GPL."

For the process side, the Linux Foundation publishes an open source checklist for mergers and acquisitions. It is "intended as a tool to help evaluate the open source practices of an organization as part of the due diligence process." Its areas include "Discovery of open source software in code bases," "Satisfaction of open source license obligations" and "Maintaining inventory of open source software." As general advice, any license question that touches the core product goes to counsel before signing.

How exposed is the software to known security risks?#

Start by checking the target's software against the flaws attackers already use. Then look at how the target finds and fixes problems. CISA's Known Exploited Vulnerabilities catalog (KEV) is, in CISA's words, "the authoritative source of vulnerabilities that have been exploited in the wild." CISA adds: "Organizations should use the KEV catalog as an input to their vulnerability management prioritization framework."

As general advice, compare the components listed in the SBOM against the KEV catalog. A match is a question for the seller's engineers: does the flawed component ship, and has it been patched?

For the wider cybersecurity posture, NIST's Cybersecurity Framework 2.0, published February 26, 2024, names six Functions: "GOVERN, IDENTIFY, PROTECT, DETECT, RESPOND, and RECOVER." NIST also says the framework's outcomes "are not a checklist of actions to perform." As general advice, use the six Functions to sort the questions you ask the seller. Ask who owns security, which assets exist and how access is controlled. Ask how an attack would be noticed and what happened in past incidents, including any data breaches.

What about data privacy and sensitive data?#

Find out what sensitive data the software holds and where it is stored before you plan any new use of it. The framework's IDENTIFY Function puts it this way: "Understanding the organization’s assets (e.g., data, hardware, software, systems, facilities, services, people), suppliers, and related cybersecurity risks enables an organization to prioritize its efforts consistent with its risk management strategy and the mission needs identified under GOVERN."

As general advice, ask for a list of the personal and payment data the software stores and the outside services that receive it. Also ask how the target handles data protection. For example, ask who can read that data. Have counsel read the target's privacy policy and customer contracts before you merge that data with yours.

Can the engineering team carry the product after close?#

As general advice, the team can carry the product when more than one person knows each critical system. Check how changes reach production, and ask the seller these questions:

  1. Which critical systems does only one person understand?
  2. Are the business rules written down, or do they live only in the code?
  3. Does every change get reviewed and tested before it ships?
  4. Who can deploy to production, and who holds the passwords and cloud accounts?
  5. Which contractors or agencies still hold code or access today?

On business rules that nobody wrote down, Gnar's audit page says: "Where nobody wrote down how it works, we explain what the main parts do."

For development practices, NIST's Secure Software Development Framework (SSDF) describes "a core set of high-level secure software development practices that can be integrated into each SDLC implementation." In that document, SDLC stands for "software development life cycle." As general advice, ask the target's engineering lead how their process covers secure development, and ask for the evidence: code reviews, test runs and dependency updates.

Will the target's software connect to your systems?#

Find out by listing every system the target's software sends data to or reads from, and how. As general advice, the answer can be an API, a file transfer, a shared database or a person retyping the data. Integration is where the target company's technology meets your own systems. Those include your ERP, CRM, order systems and any legacy systems. Integration challenges and their cost belong in the deal model.

Gnar's audit page includes this in its scope: "A Gnar code audit checks the code, how it is put together, and how it connects to your other systems." As general advice, decide early which system will be the record for customers, products and prices after close. Each of those decisions sets the integration requirements and the work that follows.

What are the red flags in technical due diligence?#

The biggest red flags in technical due diligence are missing tests, unclear code ownership, risky licenses and known flaws that still ship. As general advice, watch for these seven hidden risks. Each one can change the price or the deal terms. Where a source quoted above covers an item, the item names it.

  • No tests around the code that runs the business. Gnar's AARP Foundation audit found "no integrated testing."
  • Contractor code with no written assignment of the copyright and no work made for hire agreement that meets Circular 30's four criteria.
  • An AGPL component that the target modified and offers to users over a network (AGPL section 13).
  • Components on CISA's KEV catalog that still ship unpatched.
  • A critical system that only one engineer understands.
  • Sensitive data with no list of where it is stored (NIST CSF 2.0, IDENTIFY).
  • Business rules that nobody wrote down, so the code is the only record of how orders, prices or claims work.

What do you do with the technical findings?#

Each technical finding goes to one of three places: the price, the terms of the purchase agreement, or the plan for after close. The table below is general advice on where common technical risks tend to go.

Finding Where it goes What to do
Missing tests on core code Plan after close Add tests before anyone changes that code
Contractor code with no assignment Purchase terms Counsel asks the seller to fix the paperwork before close
Modified AGPL component in the hosted product Price or terms Price the work to replace it, or plan to offer the source
Component on the KEV catalog Terms or plan Patch before close, or first in the plan after close
One person holds key knowledge Terms A plan to keep that person through the handover
Software that needs a rebuild Price A costed rebuild plan in the deal model

Gnar's audit page lists three options, "Keep it, fix it, or rebuild it", and adds: "Your options, and the next steps for each one." It lists quick fixes apart from the bigger choices: "Small fixes your team can make now, kept separate from the big decisions." When a part needs fixing or replacing, the choice is between refactoring, replatforming and rebuilding. Gnar's post on replatform, refactor or rebuild explains how each one differs in scope and cost.

As general advice, a rebuild finding needs a rough price before it goes into the deal model. It needs a firm plan after close. For the firm plan, one route is Gnar Discovery and Design, which the page describes this way: "Every Discovery engagement ends with a Milestone Project Plan that breaks your build into clear phases, each with a fixed price." The page lists the cost: "The Gnar Company’s Discovery costs $20,000 to $30,000, depending on the tier."

Should you use your own team or technology due diligence consulting?#

Use your own engineers when they have the time and have worked in code like the target's. Hire technology due diligence consulting when they do not. Outside technical due diligence services also help when the seller will not let a competitor's engineers read its code before close. These points are general advice.

Gnar gives the same advice about its own software work. When a buyer says they have engineers of their own, Gnar says: "Often you should use them. If your own engineers have the capacity and the direction, do it internally and we will say so on the call."

What should you ask a diligence consultant before hiring one?#

Ask how the consultant checks the code, how the report ranks findings and who keeps the code afterward. As general advice, ask any technical due diligence consultant these questions before you hire one:

  • Do your engineers read the code and run the tests, or only interview the seller's team?
  • Will the report rank the findings, worst first, and give a cost for each fix?
  • Will it say which areas you could not check?
  • Can my own engineers check each finding?
  • Who signs the NDA with the seller, and who keeps the code afterward?

Where Gnar's free code audit fits#

Gnar's free code audit reads code a company already has and returns a written report of what it finds. After close, the target's code is code your company runs. The audit page opens with what the audit is: "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."

The audit page lists what is needed to start: "Two things: a signed non-disclosure agreement and access to the code." It describes two ways in: "Your own team’s code, or code someone left you." It explains what comes back: "A written audit, worst problems first, with what to do about each one. We walk your leaders and your engineers through it."

It also states who does the work: "Senior engineers at The Gnar Company, all based in the U.S." And it states what you owe afterward: "No. The Gnar Company’s code audit does not commit you to anything." The same answer adds: "If your own engineers can make the fixes, the audit says so."

As general advice, pair a code read with counsel's review of intellectual property, licenses and privacy. Add your finance team's review of technology costs and your own interviews with the seller's engineering team.

Frequently asked questions

What is technology due diligence consulting?

Technology due diligence consulting is an outside review of a target company's software before the purchase agreement is signed. As general advice, the consultant reads the code, checks who owns it and which licenses it carries, and reviews security and the engineering team. The report ranks the risks so the buyer can set the price, the terms and the plan for after close.

How is technical due diligence different from financial due diligence?

As general advice, financial due diligence tests the numbers the seller reports, such as revenue, margins and debts. Technical due diligence tests the software those numbers depend on. It asks whether the software works as described, who owns it, which licenses and security risks come with it, and what it will cost to keep, fix or connect after close.

Does running a modified GPL program on a website require releasing the source?

No, according to the GNU Project's GPL FAQ, which says a company running a modified GPL program on its web site does not have to release the modified sources. The same FAQ says the answer changes under the GNU Affero GPL. When the site sends separate GPL programs to visitors, such as JavaScript, the source of those programs must be released to them.

Who owns code that a contractor wrote for the target company?

Ordinarily the contractor who wrote it. The U.S. Copyright Office's Circular 30 says the author is ordinarily the person who created the work, and a work made for hire is the exception. Commissioned code is made for hire only if it meets four criteria, including one of nine listed categories and a written agreement signed by all parties. As general advice, have counsel also look for a written assignment of the copyright.

Does a code audit cover all of technical due diligence?

No. As general advice, a code audit covers the code itself, such as security holes, missing tests, technical debt and how the code connects to other systems. Who owns the code, what the contracts and licenses require, and what the target promised customers about their data are questions for counsel and the seller.

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.

Stay In The Loop

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