Skip to content

fix: vuln-scan tap names + JSON salvage (#62, #92) and disable Homebrew analytics#103

Merged
msitarzewski merged 2 commits into
mainfrom
fix/vuln-scan-tap-names-and-json-salvage
Jun 19, 2026
Merged

fix: vuln-scan tap names + JSON salvage (#62, #92) and disable Homebrew analytics#103
msitarzewski merged 2 commits into
mainfrom
fix/vuln-scan-tap-names-and-json-salvage

Conversation

@msitarzewski

Copy link
Copy Markdown
Owner

Two related fixes, one commit each.

fix(vulns): tap-qualified names (#92) + JSON salvage (#62) — 08950d1

The two remaining bug keepers in the backlog, both vulnerability-scan failures.

  • [brew-browser] Vulnerability scan failed for anomalyco/tap/opencode #92 invalid_argument — scan rejected tap-qualified formula names like anomalyco/tap/opencode. validate_formula_name/validateFormulaName now allow / but enforce the exact user/repo/name shape (reject empty segments, leading/trailing slash, ./.., deeper paths). scan_one/scanOne match the reported record by exact name or last /-segment, since brew vulns may echo the bare or tap-qualified form.
  • [brew-browser] Vulnerability scan failed for whatcable #62 json_parse — scan choked when brew printed a banner/notice on stdout around the --json document. parse_scan_output/parseScanOutput salvage the JSON document out of line-oriented noise (first [/{ line → last ]/} line); a malformed bracketed payload still errors, and pure prose on a clean exit yields [] instead of a scary parse error. Tauri also gains --quiet (native already had it).

fix(privacy): disable Homebrew's own analytics on app-spawned brew — 6821364

A user reported a startup connection to *.influxdata.com. Root cause is Homebrew's own analytics (brew 4.0+ pings InfluxDB Cloud unless HOMEBREW_NO_ANALYTICS=1), fired because we shell out to brew — not Brew Browser telemetry (we send none). We now set HOMEBREW_NO_ANALYTICS=1 on every brew subprocess we spawn; the user's own global brew-analytics preference for manual CLI use is untouched.

  • Tauri: brew/exec.rs gains BREW_ENV + apply_brew_env(), applied at the 2 exec spawn sites + 3 vulns/client.rs spawn sites.
  • Native: BrewService.brewEnvironment() (NO_ANALYTICS + NO_COLOR + NO_ENV_HINTS) at runCapture + runStreaming.

See https://docs.brew.sh/Analytics.

Tests

  • cargo: 77 vulns tests + analytics env test, 0 failures (+8 new)
  • swift: 145 tests in 22 suites passed (+9 new)
  • Both shells in parity.

🤖 Generated with Claude Code

msitarzewski and others added 2 commits June 17, 2026 13:03
…an output

Fixes two vulnerability-scan bugs from the issue backlog.

#92 (invalid_argument): scan rejected tap-qualified formula names like
`anomalyco/tap/opencode`. validate_formula_name / validateFormulaName now
allow `/` but enforce the exact `user/repo/name` shape (reject empty
segments, leading/trailing slash, `.`/`..`, and deeper paths). scan_one /
scanOne match the reported record by exact name OR last `/`-segment, since
`brew vulns` may echo the bare or tap-qualified form.

#62 (json_parse): scan choked when brew printed a banner/notice on stdout
around the `--json` document. parse_scan_output / parseScanOutput now
salvage the JSON document out of line-oriented noise (first `[`/`{` line to
last `]`/`}` line); a malformed bracketed payload still errors, and pure
prose on a clean exit yields `[]` instead of a scary parse error. Tauri
also gains `--quiet` (native already had it) so brew's chatter stays off
stdout in the first place.

Tests: cargo +7, swift vulns +7. Both shells in parity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A user reported a startup connection to `*.influxdata.com`. Root cause is
Homebrew's own analytics (brew 4.0+ pings InfluxDB Cloud unless
HOMEBREW_NO_ANALYTICS=1), fired because we shell out to `brew` — not Brew
Browser telemetry (we send none). Set HOMEBREW_NO_ANALYTICS=1 on every brew
subprocess we spawn so we never trigger it on the user's behalf; their own
global brew-analytics preference for manual CLI use is untouched.

Tauri: brew/exec.rs gains BREW_ENV + apply_brew_env(), applied at the 2 exec
spawn sites and the 3 vulns/client.rs spawn sites.
Native: BrewService.brewEnvironment() (NO_ANALYTICS + NO_COLOR +
NO_ENV_HINTS) at runCapture + runStreaming.

Tests: cargo +1, swift +2.

See https://docs.brew.sh/Analytics.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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