Skip to content

fix(security): allowlist the #131 test fixture in gitleaks history - #160

Merged
Zongwei9888 merged 1 commit into
mainfrom
fix/gitleaks-131-fixture
Aug 6, 2026
Merged

fix(security): allowlist the #131 test fixture in gitleaks history#160
Zongwei9888 merged 1 commit into
mainfrom
fix/gitleaks-131-fixture

Conversation

@Zongwei9888

Copy link
Copy Markdown
Collaborator

Why

The Secret history scan has failed on main since dd8f0a8. The step is named "Install pinned Gitleaks", but its last line is the scan itself:

./gitleaks git --redact --no-banner --exit-code 1

so an install-shaped failure was actually leaks found: 1. The download and checksum were fine (gitleaks.tar.gz: OK).

Cause

dd8f0a8 merged ten stale pull requests with -s ours to record their authors as contributors. That strategy leaves the tree untouched — but it does make each branch's commits ancestors of main, and gitleaks scans history, not the working tree.

One of them, #131, contains a finding.

The finding

tests/ui_session_resume_test.py:87, from commit 6421db9a:

RuntimeError(
    "Workflow execution failed: <html><h1>504 Gateway Time-out</h1></html> api_key=sk-secret123456"
)

A fixture, not a credential: the literal sk-secret123456 exists to assert that error text is redacted before it reaches the UI. Nothing to rotate.

The file does not exist on main — the -s ours merge never applied its tree — so the finding cannot be fixed by editing it. A fingerprint entry is the only route.

Verification

gitleaks git --log-opts=origin/main
  240 commits scanned.
  no leaks found

Worth recording for next time

-s ours merges bring the branch's whole history under the secret scan. Two branches deliberately left unmerged carry findings of their own — and #133's is a real key, not a fixture. Merging those for attribution alone would have put a live credential in main's history permanently, where only a rewrite could remove it.

The Secret history scan has failed on main since dd8f0a8. Cause: merging #131
with -s ours recorded the branch in history without applying its tree, and
gitleaks scans history, not the working tree.

The finding is a fixture, not a credential — the literal "sk-secret123456"
inside a RuntimeError message, asserting that error text is redacted before it
reaches the UI. Its file, tests/ui_session_resume_test.py, does not exist on
main, so the finding cannot be fixed by editing it; a fingerprint entry is the
only route.

Verified: gitleaks over origin/main now reports no leaks across 240 commits.

Note for future -s ours merges: they bring the branch's full history under the
secret scan. Two branches deliberately left unmerged (#133, #143) carry
findings of their own, and #133's is a real key — merging them for attribution
alone would have put it in main's history permanently.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Zongwei9888
Zongwei9888 merged commit 8b2f59b into main Aug 6, 2026
14 checks passed
@Zongwei9888
Zongwei9888 deleted the fix/gitleaks-131-fixture branch August 6, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant