All research

Writing about static code audit results

Use this guide to describe a static code finding in terms that reviewers and maintainers can act on. You will learn how to explain what was observed in source, what still needs runtime evidence, and how to suggest a fix without publishing private code.

Research brief4 min read

What a static finding can establish

A static audit can show that source code contains a risky pattern. A public write-up often goes further by implication. If it says an attacker accessed a database or a user reached an internal function, it makes a claim about a running system. To say that responsibly, you would need evidence about deployment, access, and behavior that a source excerpt alone cannot supply.

State which kind of review produced the evidence before giving an impact statement. An alert in a pull-request diff and a finding in an audit of the current repository have different coverage. A match in reviewed source can support an explanation of how a value is used. Whether the same code ships, what can reach it, and which controls apply at runtime are separate questions. Phrase the potential consequence in terms of the conditions you can support.

Pentoma Code reports static findings with a code location, an explanation, and a proposed fix. Its coverage notes state what the audit covered, skipped, or checked only in part. Keep those notes close to the claim they qualify. A confident description of the code pattern gives the reader a place to start, even when there is no evidence about exploitation in a deployed environment.

For a repeatable editorial review, ask a maintainer to highlight which sentences depend on a deployment assumption. Keep the working notes that support those assumptions with the private finding. If an assumption remains unresolved, call it out in ordinary language so a reader can tell the difference between a reason to investigate and an observed consequence.

Northmere’s invoice lookup in source

The fictional Northmere code audit found an invoice lookup that builds a SQL statement using string interpolation. The fixture records a static match. A useful excerpt says that the query construction mixes an input value with statement text and that the audit did not establish runtime behavior. It can communicate both points without printing the statement, source path, rule identifier, or commit history.

PentomaCode security audit

Invoice lookup builds SQL with string interpolation

The fictional audit observed the pattern in source. Runtime behavior was unverified.

How to fix

Use a parameterized query and pass the lookup value separately from the SQL statement.

  • Static finding
  • CWE-89
PNTM-CODE-2026-1109-NM01Public excerpt
Sample data from the fictional Northmere engagement.

Keep the fix tied to the cause. A parameterized query keeps the variable value in a separate argument so the driver handles it as data. That recommendation lets a maintainer identify the relevant database call in their own codebase. The private finding can direct the owner to the location and the revision under review. The public exhibit can stay at the level of the engineering change.

Provide the expected behavior of a defensive regression test in words. The lookup should continue to find the intended invoice for approved inputs, and values supplied by the caller should remain data. A reviewer can check those properties in a controlled environment without using a real tenant record or publishing an input crafted to alter a statement. If the only record you have is the suggested fix, mark it as proposed.

What to publish and what to withhold

PublishWithholdReason
The code pattern, the affected responsibility, and the kind of reviewProprietary source, file paths, exact line ranges, commits, and repository namesA maintainer can recognize the pattern without learning where another organization implements it.
The potential consequence and any assumptions needed to support itUnverified claims about reachability, attacker access, or data exposureSource evidence and deployed behavior answer different questions.
A fix stated as a change to the code and a way to assess its behaviorReproduction inputs and private test fixturesThe reader needs an engineering requirement that transfers to their codebase.
The scope reviewed and material gaps that affect the claimComplete dependency inventories, internal review threads, and any secret valueThe coverage statement can be useful without revealing the organization’s development environment.

Before you publish

  • Label the evidence as static and identify the type of audit that produced it.
  • Separate what was observed in code from any inference about runtime impact.
  • Check that the suggested change addresses the code pattern and that the verification status is accurate.
  • Review the public output for source fragments, line numbers, repository metadata, and embedded links.
  • Get approval from the source owner before releasing any excerpt that draws on private work.

Limits

This guide addresses reporting a static pattern. A runtime verification and a judgment about the reach of the affected code require separate evidence. Classification labels are a way to index the pattern. The OWASP Top 10:2021 references on this brief remain in their original edition.

A real finding may involve code owned outside your organization or a credential that needs revocation. The appropriate owner and private response process should handle those details.

References

Scope a code security audit for your repository

Request a pentest