carlos / platform Public

review: Astra round 3 findings for gitleaks-1251 (NOT READY, parked)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 7aac432046d31544a8055130a07367ce4938f800 parent 614cc4a
1 file changed, +41 −0
  • docs/superpowers/reviews/FINDINGS-gitleaks-1251-R3.md +41 −0

CI passed — run details

diff --git a/docs/superpowers/reviews/FINDINGS-gitleaks-1251-R3.md b/docs/superpowers/reviews/FINDINGS-gitleaks-1251-R3.md
new file mode 100644
index 000000000..cd3c1e3b8
--- /dev/null
+++ b/docs/superpowers/reviews/FINDINGS-gitleaks-1251-R3.md
@@ -0,0 +1,41 @@
+Reviewed `origin/main...614cc4ae228f6def225d1a9fc49189a4aecd229a`, round 3 of 3. The difference from the brief’s named commit is only the brief itself.
+
+1. **P1 — Digest-shaped entries are approved without establishing that their values are checked digests.**
+ [scripts/gitleaks-gate/judge.go:127](/home/paulca/amadan.net/carlos/platform-gitleaks-1251/scripts/gitleaks-gate/judge.go:127)
+
+ **Failure scenario:** put a real 64-character lowercase hexadecimal credential under `"internal/console/auth.go"` in the checklist’s `source_hashes` object. The scanner reports it as `generic-api-key`; the judge accepts it because the line matches and `Secret` equals the value. No repository test validates that checklist’s hashes. The judge also accepts matching lines outside `source_hashes`, because it never parses the surrounding JSON.
+
+ The census protection is incomplete for the same reason. `TestPlan9B8RecordWriteCensus` compares the **effective inventory** with source digests. It does not validate every matching line in every `_census_test.go` file. An unused `[]censusEntry` declaration containing a credential passes the judge without entering that inventory. Historical entries overwritten by later layers likewise do not have their original digest checked by that comparison.
+
+ **Evidence:** the pinned v8.30.1 scanner detected generated hexadecimal keys in both a checklist entry and an unused census entry, with the exact `Secret`, rule and single-line location that `approve` accepts. All 28 existing checklist hashes match their declared historical source revision, but that relationship is not enforced by CI.
+
+ **Fix:** require independent verification of each accepted digest, including its inventory membership or historical source, and reject entries without that evidence. Add negative cases for an incorrect checklist digest, a matching line outside `source_hashes`, and an unused census declaration. Shape alone cannot provide the required approval.
+
+ **Fault family:** allowances must distinguish approved source digests from credentials—the same invariant as the earlier rounds.
+
+2. **P1 — The sentinel overwrites a tracked file before scanning it.**
+ [scripts/gitleaks-gate/main.go:159](/home/paulca/amadan.net/carlos/platform-gitleaks-1251/scripts/gitleaks-gate/main.go:159)
+
+ **Failure scenario:** commit a root-level `gitleaks-gate-sentinel.env` containing a credential. `copyTracked` copies it into the scan tree, then `os.WriteFile` truncates it and substitutes the generated sentinel. The scanner therefore never sees the committed credential. Its replacement satisfies `sawSentinel`, allowing the gate to pass.
+
+ **Evidence:** this follows directly from the copy/write ordering. The pinned scanner detected a synthetic credential in equivalent environment-file content; the wrapper would remove that content before invoking it.
+
+ **Fix:** create the sentinel exclusively at an unused path, or reject a tracked-path collision before writing. Exempt only the generated sentinel finding, and add a regression case containing a tracked file with the current sentinel name.
+
+ **Fault family:** scan coverage must preserve every tracked file’s contents.
+
+No additional P2 or P3 findings.
+
+The remaining checks found:
+
+- **Report handling:** the judge compares `Secret` with the digest captured from the actual file line, requires a single-line finding, and rejects `decoded:` tags. Malformed/truncated JSON, inconsistent exit status, missing reports, missing binaries and version mismatches have rejection paths.
+- **Empty scans:** zero copied files fails; failure to detect the generated sentinel also fails. The collision above defeats coverage despite those checks.
+- **Self-test wiring:** `80-gitleaks` invokes `make gitleaks`, whose wrapper runs the self-test before scanning tracked files. Planted cases must be detected by both the default-rule control and the configured scan after judging.
+- **Exact allowances:** all 35 expressions are anchored exact values. Their repository uses support the documented fixture, test, digest-fragment or non-secret explanations; I identified no live credential among them.
+- **Documentation:** README, AGENTS.md and the step header match the invocation and intended behavior, subject to the coverage failures above.
+
+`git diff --check`, shell syntax checking and formatting checks passed. Scanner probes used the cached, version-verified executable. The complete wrapper/self-test was not executed because it requires filesystem writes unavailable in this sandbox. Access to amadan #1251 was blocked by network restrictions. No files were changed, reviewers spawned or full suites run.
+
+This exhausts round 3 and repeats the allowance fault family. **Cutting or holding the new step is better than starting another repair/review round without Paul’s explicit decision.**
+
+NOT READY
\ No newline at end of file