Source code security
Reading your own source code for vulnerabilities
The cheapest fix is the one that never ships. A manual review finds the vulnerability at the line that creates it.
Mapping before reading
Reading a repository from the top file down wastes the first day. Before reading anything in detail, we map it: where untrusted data enters, where it crosses a boundary, where authentication and authorisation decisions are made, and which paths carry that data onward.
The map comes from the entry points — HTTP handlers, message consumers, scheduled jobs, CLI tools, upload handlers — and from the framework's own routing and middleware configuration. It is short, and it decides where the review spends its time.
Then we read along the paths, not along the files. A vulnerability is a path from an untrusted source to a dangerous operation, and a file-by-file reading finds neither end of it reliably.
The dangerous operations
Every serious finding in a code review is the same shape: data the attacker controls reaches an operation that does not treat it as hostile. The operation is rarely exotic — it is a query built by concatenation, a shell command assembled from a parameter, a template rendered from user content, a deserialiser handed an untrusted blob, a path built from a request value and passed to the filesystem.
The review question at each of those points is precise: what stops an attacker-supplied value from reaching this call, and is that control applied on every path that reaches it? The answer is often that the control exists in the web tier but the service also exposes a gRPC endpoint, or that the sanitiser runs before a second transformation re-introduces the problem.
- Query and command construction from concatenated input
- Template rendering and HTML construction without contextual escaping
- Deserialisation of untrusted data, and type confusion around it
- Filesystem and archive handling driven by request-supplied paths
- Cryptographic primitives used incorrectly: static keys, weak modes, predictable nonces
- Secret material in source, fixtures, comments or configuration defaults
Authentication, authorisation and tenancy
In application code the recurring bugs are in the decision layer rather than the transport layer: a role check that returns early, an object lookup that filters by id but not by owner, a tenancy check applied to the list endpoint but not the export endpoint.
Reading the code is where those become obvious, because the inconsistency is visible in the diff between two handlers that should have looked alike. This is the finding type that most often survives a full penetration test and gets fixed by a source review.
The code you did not write
Dependencies are reviewed by how the application uses them, not by version number alone. A library with a serious advisory that you call one narrow, safe function from is a different priority from the same library used to parse untrusted uploads.
Look at lock files, install scripts, build steps and generated artefacts. Typosquatting, unpinned transitive dependencies and packages that execute at install time are all supply-chain findings, and they are all visible in a repository review.
What we hand back
Findings that point at a file, a function and the change to make — the output a developer can turn into a ticket without re-deriving the problem. A dependency audit ranked by usage. And a walkthrough with the engineers who own the code, because the answer to "why is this here" usually belongs to them.
After the fixes, we review the patches and retest the affected paths, so the review closes with evidence rather than a comment thread.