Repository navigation
Redact resolved and lexical home forms before long-token wipe - #22
Merged
10-X-eng merged 2 commits intoNov 6, 2026
Merged
Conversation
Apply email/home/username redaction before the ≥80-char wipe, and keep both lexical and resolved (/var vs /private/var) home forms so long temp paths become [home] instead of [long value omitted]. Split from stevecad#18.
Contributor
|
Thanks for the contribution! This is driven by macOS path behaviour, which isn't a supported platform, and it reorders the redaction applied to diagnostic reports in a way that could let secrets through. A maintainer needs to decide on it. We'll follow up here. |
Changing part of a secret first (an account name inside a token) left the rest of it in the report. Secrets now go first; the long-value wipe still runs last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Thanks, merged. One change on top: report redaction now removes the app's known secrets first, before the home, email and account-name passes. Otherwise a token that contains the account name was partly rewritten before it could be matched, and the rest of it stayed in the report. There's a test for it (test_secret_holding_the_account_name_is_removed_whole). The long-value wipe still runs last, as you had it. |
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.
What doesn't work
On macOS,
/tmpand/varare symlinks to/private/tmpand/private/var. Temp paths fromtempfiletherefore show up as/var/folders/…, while anything that callsPath.resolve()returns/private/var/folders/….diagnostics.redact_reportfails to scrub the home path in that case:[A-Za-z0-9_+/=.-]{80,}) runs before home redaction and includes/, so a long absolute path is replaced with[long value omitted]and never becomes[home].homeandPath(home).resolve(), so the unresolved/var/…form (what the log actually contains when the home dir is a symlink) still leaked.tests.test_desktop_feedback.RedactionTests.test_resolved_home_and_hyphenated_api_keys_are_removedfails only on Mac for this reason.The change
src/steve_desktop/diagnostics.py: collect home forms (raw,resolve(), symlinkreadlinktarget, and the/private-stripped twin), redact email / home-folder patterns / those home forms / username before_redact(so the long-value scrub cannot eat paths first). Long secrets and bearer/api-key rules still run afterward.tests/test_desktop_feedback.py: add a symlinked temp-root test that embeds both lexical and resolved forms (reproduces on Linux too) and asserts paths ≥80 chars become[home]not[long value omitted]; add a both-ways check that ordinary short text survives while long opaque values are still scrubbed.No change to the two resolved-path test expects (those land in the companion PR). No change to
windows_updates.py, updater, signing,local_git.py, workflows, or deps. Split from #18; this PR carries only the redaction half.Tests
Studio Mac (
/tmp/cadmac-smoke/venvread-only,PYTHONPATH=src:.,QT_QPA_PLATFORM=offscreen, vault_hook armed underpython -m unittest,pgrep SecurityAgentempty before and after; no smoke test;/tmp/cadmac-smokeleft alone):tests.test_desktop_feedbackunittest discover583e858d7c2231The remaining 3 discover failures on this branch are: the two resolved-path test expects (covered by the companion PR) plus a pre-existing
test_hot_workerfailure also present on upstream main on this Studio (not introduced here). Focused redaction module is green standalone.