In code review, which changed files get skimmed rather than read, and why does that matter?
answer
- the files nobody actually reads
- machine-generated, so assumed safe
- binary diffs render as nothing
- trust granted by file type, not content
- regenerate in CI and compare
basics
~10 sLockfiles, generated code, vendored directories and binary fixtures. Reviewers approve them because the diff is machine-produced or unreadable, so a change hidden there inherits the trust of reviewed code without anyone having read it.
solid answer
~50 sEvery repository has file classes that receive an approval but not a reading: dependency lockfiles, generated clients and protobuf output, vendored third-party trees, minified or bundled assets, and binary test fixtures such as golden captures, reference images or sample archives. Reviewers skip them for rational reasons: the diff is thousands of machine-written lines, or it renders as `Binary files differ`. That matters because an insider or a stolen developer session does not need a clever exploit; it needs one file in the change set that nobody reads. The fix is not to demand people read them. It is to make each class safe by construction: regenerate generated files in CI and fail if the checked-in copy differs, review the lockfile as a list of added package names rather than as a diff, and treat a binary fixture as an artifact that must be reproducible from a committed script.
go deeper
Be ready to name the file classes that get an approval without a reading — lockfiles, generated code, vendored trees, binary fixtures — and to say plainly why a reviewer skips them.
Explain the mechanism that makes each class safe again: regenerate and compare in CI, review a lockfile as a set of added package names, require binary fixtures to be reproducible from a committed script.
Show that you prioritise. Say which blind spot you close first and why, and connect the choice to what the unread file can reach — a build runner holding tokens beats a cosmetic asset.
Own the tradeoff between reviewer attention and coverage. Argue why a rule demanding people read everything degrades the value of every approval, and what you replace it with across an estate.
## The premise Code review is the only control in most organisations that inspects the *content* of a change. Authentication tells you who pushed it, branch policy tells you that somebody approved it, and CI tells you the tests passed. None of those read the change. So the practical security question is not whether a repository requires review, but which parts of a change set are actually read by a human — and every real repository has categories that are not. ## The classes that get skimmed **Dependency lockfiles.** A resolved lockfile change can be thousands of lines for a one-line manifest edit. Reviewers approve on the manifest and assume the lockfile is its consequence. It is not — a lockfile can name packages and resolved sources that the manifest never asked for, and it will be the file the installer actually obeys. **Generated files.** Protobuf or API clients, ORM schemas, compiled templates, bundled assets. The social contract is that a machine wrote them, so reading them is pointless — which is precisely why an edit to one survives review. **Vendored trees.** A committed copy of a third-party library. The first commit is huge and unread; every later edit is read as an upgrade rather than as source. **Binary fixtures.** Golden capture files, reference images, sample archives, recorded HTTP transcripts, model-weight blobs. The interface offers no diff at all. A reviewer literally cannot read the change without deliberately extracting and inspecting the file. **Test and tooling code.** Read fast, if at all, because it does not run in production — but it *does* run on a build machine that usually holds credentials. ## Why this is a supply chain problem, not a hygiene problem An attacker who already holds legitimate commit rights — a contributor, a contractor, a stolen session belonging to a real teammate — has no need to defeat identity controls. Every authentication control has already granted them what it can grant: proof that the actor is who they claim to be. The remaining control between them and your artifact is a human reading a diff. They therefore aim the payload at the part of the diff that is not read, and the change looks routine: a refreshed fixture, a regenerated client, a lockfile update alongside a genuine dependency bump. This is also why the usual reassurances do not apply here. A signed commit binds the change to an identity; it says nothing about whether the change is safe, and the identity in question is authorised. Provenance and build attestations describe how the artifact was produced from this source; when the source itself is hostile, the build is honest and the attestation is truthful. Reproducible builds reproduce the payload byte for byte. All of these controls close a different gap — tampering between the reviewed source and the shipped artifact — and this attack is upstream of all of them. ## What to do about it The wrong response is to demand that reviewers read everything. Reviewer attention is finite, and a rule people cannot follow produces approvals that mean even less. Make each class safe by construction instead: - **Generated files:** regenerate them in CI from the committed source and fail the build if the result differs from the checked-in copy. The file is then a function of reviewed input, and a hand-edit is a build failure rather than a review problem. - **Lockfiles:** review the *semantic* change — which package names and sources were added, removed or repointed — rather than the raw diff. Tooling can render this; the reviewer's job is to confirm the added names are the ones the manifest change implies. - **Binary fixtures:** prefer fixtures generated at test time from committed source. Where a real binary must be committed, require that it be reproducible from a script in the repository, and record its hash and who produced it so a later swap is visible as a hash change with no accompanying source change. - **Vendored code:** treat an update as a dependency upgrade with a stated upstream version and a verifiable source, not as an ordinary diff. - **Blast radius:** assume some change will get through unread, and reduce what an unread change can reach — builds and tests that run without production credentials and without unrestricted network egress limit what a payload accomplishes even when review misses it. ## Interview framing The answer an interviewer wants is the honest one: review is a real control, it has known blind spots, the blind spots are predictable by file type, and the durable fix is to move those file types out of the class of things a human must read.
- A reviewer approves a large lockfile change because CI passed. What is wrong with that reasoning?CI proves the code builds and the tests pass, which a hostile package does too — its install step or a new transitive entry runs on the build machine regardless of whether tests go green. The check that matters is whether the packages the lockfile added are the ones the manifest change implies; passing tests carry no information about that.
- How do you make a generated file safe to skim rather than forcing people to read it?Regenerate it in CI from the committed source and fail if the result differs from what is checked in. The file becomes a function of reviewed input, so a hand-edited or extra line is a build failure. Reviewers then read only the source and the generator version, which is a diff a human can actually hold.
- Which review blind spot would you close first in a repository you just inherited?The one whose file class runs on a machine that holds credentials — build scripts, test helpers and fixtures they read. Generated production code matters, but a payload in tooling executes on your build runner with its tokens, which is a shorter path to real damage than shipping something to users.
It is the customs queue: officers open the suitcases and wave through the sealed pallets, because opening a pallet takes an hour. Anyone smuggling knows which line to join.
saying these in an interview costs you the question
- Says a signed commit means the change was reviewed
- Assumes a green CI run implies the diff was safe
- Treats binary fixtures as inert data that cannot cause execution
- Thinks only large or complex diffs carry real risk
- Proposes requiring reviewers to read every generated line