Repository navigation
browse: redact query values from the audit origin and network log (GST-1635) - #4082
Merged
Merged
Conversation
…rub short digit pieces (GST-1635) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…asses (GST-1635) The literal user:password URL tripped creds.basic_auth_url in the pregate and in CI's quality credential scan. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nt names what stays recorded (GST-1635) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes GST-1635. The audit
originfield andbrowse-network.lognow keep scheme, host, path and query parameter names, with every query value written as[REDACTED]and userinfo and fragment dropped. The audit error scrub also removes 2- and 3-character value pieces that contain a digit (a CVV, an expiry month), as whole tokens only.Full body follows from /ship.
What changed
The audit line for a page reached by a GET form: before, the origin kept the typed password and CVV and the error kept the 3-digit CVV; after, every query value and the CVV piece are [REDACTED].
Before/after as text: The audit line for a page reached by a GET form: before, the origin kept the typed password and CVV and the error kept the 3-digit CVV; after, every query value and the CVV piece are [REDACTED]
Follow-up commit befd12d: a query piece whose value is empty or only
=is now written as[REDACTED]whole, so a bare base64 token with=padding (?c2VjcmV0==) no longer reachesbrowse-audit.jsonlorbrowse-network.logas a parameter name. A named parameter with an empty value (flag=) is now[REDACTED]whole too, where it used to keep its name. The changelog fragment now says exactly which places are covered and lists what is still recorded as typed (navigation command arguments such as agotoURL, URL paths, andbrowse-console.logtext).Why
GST-1631 left two known limits. The audit log's
originfield stored the full page URL, so after a GET form submit the next line held what the user typed, and short secrets such as a 3-digit CVV survived in error text. Nowbrowse-audit.jsonlandbrowse-network.logkeep only the scheme, host, path and query parameter names, and 2-3 character pieces of a redacted value that contain a digit are scrubbed from error text as whole tokens. The follow-up commit closes the padded-token gap the first review noted, because a bare token's text would otherwise survive as a parameter name, and it narrows the changelog fragment so it no longer claims more than ships.Blast radius
The new
redactUrlruns only where browse writes a URL to disk, which is the auditoriginfield (writeAuditEntry, browse/src/audit.ts) and eachbrowse-network.logline (formatNetworkLogLine, called fromflushBuffersin browse/src/server.ts). The in-memory network buffer, which browser-manager matches by raw URL to update status and size, is untouched, so redacting only at format time cannot break that matching (red-team reader traced the callers; file:line read). The digit-piece scrub only adds needles toscrubSecrets, matched as whole tokens, so its worst case is extra[REDACTED]in error text such asline 12, never a leaked value. The befd12d change is one condition inredactUrl's per-piece map, so its worst case is a parameter name lost from an empty-value piece, which costs debugging detail and never leaks a value (all 46 audit-redaction cases passed at befd12d).Approvals
Approved: yes (record r-a2cb27db7fa6). The full approval record stays private: this repository is public or its visibility is unknown.
This is a bug fix (R65: no plan review; failing-first tests instead). The first round: 7 new cases failed before the fix while 38 existing cases passed, then all 45 cases passed. The follow-up commit befd12d: its new case failed at 4f87b29 while the other 45 cases passed, then all 46 cases passed.
Review-loop exception for this PR: the Captain's grant (approval a-5393611ebb88, scope "#4082 review_loop_exception") allowed one scoped fix round past the two-round cap, limited to the two hunks of befd12d, with anything a reviewer raises recorded as a note. Merging follows the crew's standing "merge when green" approval through the GStack Minder land queue.
Summary
Two GST-1631 follow-ups ship together. The audit
originand the network log now record every query value as[REDACTED]while keeping parameter names, write a piece with an empty or=-only value as[REDACTED]whole, and drop userinfo and the#fragment; an unparseable origin is cut at its query. Every query value is redacted, not a key-name list, because a page's GET form can name a field anything (cvv,q,ccnum), which the args filter's name list would miss. The error-text scrub now also removes 2-3 character pieces of a redacted value that contain a digit, such as a CVV or an expiry month, as whole tokens, while word pieces likeaorisstay so the error text remains readable./ship also fixed two things on the way: a test URL with a literal
user:passwordpair tripped the credential scan in the pregate and in CI'squalitycheck, so the test now builds the same URL from a variable, and a red-team note movedformatDialogLogLine's doc comment back onto it. The Captain's one scoped round (befd12d) then fixed review notes 1 and 2 from the first /ship.Test Coverage
Coverage: deterministic (each of 3 changed runtime files has a changed test naming it; no audit reader).
Regression proof: 7 new cases fail at the base revision and pass after the fix (lane failing-first log: 38 cases passed and 7 failed before, all 45 cases passed after). The befd12d case fails at 4f87b29, where the other 45 cases passed, and passes at befd12d, where all 46 cases passed.
Tests ran at befd12d: all 46 audit-redaction cases passed (lane log); the free suite carried from free-tests.yml run 42252745678/1 at tree e2456f4696c8 (35,990 tests); macOS obligations cleared from run 42252745678 and Windows smoke from run 42251738510.
Pre-Landing Review
Full panel at 4f87b29 (security class, full depth): batched specialist (testing, security, state machines), red team, native adversarial (anthropic/claude-opus-5-5) and an outside voice on another model family (openai/gpt-6.1-sol, via a host subagent), plus one fix-check on the fixed range.
Pre-Landing Review: 1 issue — 1 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 4 noted
formatNetworkLogLinesat underformatDialogLogLine's doc comment → moved the dialog doc back and gave the network formatter its own one-line doc (4f87b29).REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=1 scope=frozen ledgers_read=4 fix_checks=1 dispatches=2
Gate edits: none detected (3 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: completed, no findings (openai/gpt-6.1-sol: "accept because no exploitable regression was found in URL sanitization, short-secret scrubbing, or persistent-log integration"). Fix-check: no findings. Native adversarial: 4 low-severity notes below, none blocking.
Scoped re-check at befd12d (J1, under the Captain's review-loop exception): one reader (anthropic/claude-opus-5-5) read the 17-line range-diff packet from 4f87b29 to befd12d plus befd12d's test hunk and changelog fragment hunk. Verdict: no findings. The receipt was carried from 4f87b29 to befd12d on that verdict with a pregate current for befd12d.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR unless marked.
browse/src/audit.ts:153redactUrl kept a bare base64 query token with = padding (?c2Vj...=) as a parameter name, so the token minus its padding reached browse-audit.jsonl and browse-network.log. A piece whose value is empty or only=is now[REDACTED]whole.changelog.d/capy-gst-1635-browse-audit-origin-query.md:1goto args still record the typed URL with its query (redactCommandArgs keeps navigation args by design), so the headline was broader than what ships. The fragment now names the two places covered and lists what is still recorded as typed.browse/src/audit.ts:152The parse-failure fallback keeps userinfo for a non-absolute input such as //u:p@host/p?a=1; page.url() and request URLs are absolute in practice.browse/src/server.ts:657Secrets in URL paths and in console text still persist: browse-console.log writes console text as-is and path tokens are kept by design. Not a regression.browse/src/audit.ts:156A parameter with an empty value (flag=) now loses its name in the log, where before it was kept asflag=[REDACTED]. That costs some debugging detail and no data or secrets, and the fragment's "a query piece with no value ... is written as[REDACTED]whole" covers it.Exploratory QA
Surface: functional (the library functions behind browse's audit log and network log; no live browser). Mode: /ship smoke, 3 of 12 probes, 300 s budget. Verdict: pass.
1234survivesLimits: smoke only; the server flush path is pinned by the unit test that asserts server.ts writes
entries.map(formatNetworkLogLine).Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Intent: redact query values from the browse audit origin and network log, and scrub short digit pieces from audit error text (GST-1635).
Delivered: redactUrl on the audit origin and network log lines, a 2-3 character digit-piece rule in scrubSecrets, tests and a changelog fragment.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
Issues
Refs p1/red-team#1
Verification Results
No plan-specific verification items (bug fix with no bound plan); VERIFY_RESULT: skipped. Automatic smoke QA above passed.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. No documentation edits were needed for GST-1635.
Scope: base b10cc47 to head 4f87b29 on capy/gst-1635-browse-audit-origin-query, covering browse/src/audit.ts (new redactUrl, audit origin redaction, short-digit scrub), browse/src/buffers.ts (formatNetworkLogLine), browse/src/server.ts, browse/test/audit-redaction.test.ts and the changelog.d fragment. Nothing was staged, unstaged or untracked.
Documentation health:
Coverage debt: Browse log redaction (GST-1631 argument redaction and GST-1635 URL query redaction) has no reference, how-to or explanation coverage outside changelog fragments. The natural home is a sentence in BROWSER.md's Capture section; run /document-generate if it is wanted.
Diagram drift: none. No diagrams reference audit.ts or buffers.ts.
Test plan
bun test browse/test/audit-redaction.test.tsat befd12d: all 46 cases passed (lane log); the new case fails at 4f87b29bun run test: carried from free-tests.yml run 42252745678/1 at tree e2456f4696c8, 35,990 tests, green