Skip to content

v1.5.0 — surface filter, actionable upgrade prompt, and security hardening

Choose a tag to compare

@siropkin siropkin released this 08 May 21:01
· 39 commits to main since this release
8d4851d

1.5.0 — surface filter, actionable upgrade prompt, and security hardening

Bundles the post-1.4.1 work tracked in siropkin/budi-cursor#42–#45, #50, and #51. Two user-visible improvements (per-host surface filtering, actionable copy when the daemon api_version is stale) ride alongside four security fixes that close drive-by primitives a malicious repo could abuse via .vscode/settings.json. No data-contract change with the daemon — ?surface=<host> and the existing ?provider=… shape coexist, and the extension still runs against any 8.4.x daemon without modification.

Added

  • Per-host ?surface=<host> filter on every analytics request (siropkin/budi-cursor#50 / PR #52). The extension now tells the daemon which IDE it is rendering for — cursor from Cursor, vscode from VS Code, vscode from VSCodium (re-uses VS Code paths in core's path-based inference). Stops the cross-IDE leak where a user with both editors installed saw the same blended dollar number on both status bars. New surfaceFilterForHost helper in src/budiClient.ts; unknown host returns [] as a failsafe so we never accidentally hide the user's data. Pairs with siropkin/budi#701 (data layer) and siropkin/budi#702 (HTTP + CLI filter).
  • budi.includeOtherSurfaces setting (default false) for the holistic-view crowd that wants the pre-#50 cross-IDE aggregation back. Documented in package.json configuration contributions; re-read on onDidChangeConfiguration and onDidGrantWorkspaceTrust.
  • Actionable upgrade prompt when the daemon api_version is stale (siropkin/budi-cursor#51 / PR #53). The previous red HealthState collapsed both "daemon unreachable" and "daemon too old" into a single budi · offline copy plus a vague toast. Split into two states so the bar copy and toast tell the user what to actually do:
    • unreachable → budi · offline (unchanged for the truly-down case).
    • version-stale → budi · update needed, with a tooltip that names the installed daemon version, the required api_version, and the platform-appropriate one-line upgrade command (budi update / brew upgrade siropkin/budi/budi / standalone installer).
    • Toast offers a Show update command action that opens a budi: Update output channel pre-populated with the right command, plus Dismiss to silence it for the session. The extension never runs the upgrade itself — daemon installs span Homebrew, manual binaries, and corp-managed paths.

Changed

  • budi.daemonUrl is now loopback-only (siropkin/budi-cursor#42 / PR #46). getConfiguration("budi").get returns the merged user/workspace value, so a malicious repo's .vscode/settings.json could pivot the extension's 15-second GET /health + GET /analytics/statusline?project_dir=<abs path> polling to an attacker URL the moment the workspace was trusted, leaking the absolute workspace path, the detected AI-extension list on non-Cursor hosts, and a presence beacon. Only http(s)://127.0.0.1, localhost, and ::1 are honored now; everything else is logged and falls back to http://127.0.0.1:7878. Schema-level pattern makes the editor's settings UI flag non-loopback values too. SOUL.md already pins the daemon as local-only, so a remote override has no legitimate use case.
  • budi.cloudEndpoint is now restricted to getbudi.dev hosts (siropkin/budi-cursor#43 / PR #47). Same primitive as daemonUrl but on the click-through side: a workspace override could redirect vscode.env.openExternal to an attacker URL and turn a status-bar click into a drive-by phishing landing. Only https URLs whose hostname is getbudi.dev or ends in .getbudi.dev are honored; everything else falls back to the default. Subdomains stay allowed so a user-scope staging.app.getbudi.dev override keeps working. Schema gains a getbudi.dev-suffix pattern.
  • HTTP responses from the daemon are capped at 64 KB and content-type-checked (siropkin/budi-cursor#44 / PR #48). Both fetchDaemonHealth and fetchStatusline now route through a single fetchDaemonJson wrapper that rejects non-2xx responses, rejects non-application/json content-types, and aborts streams over 64 KB — a fast loopback peer could previously flood hundreds of MB inside the 3 s timeout window and OOM the extension host. Real /health and /analytics/statusline payloads are well under 1 KB, so 64 KB still leaves slack for forward-compat fields. Defense in depth alongside the loopback allowlist from #42 — even with a benign daemon, this protects against the daemon misbehaving.
  • Untrusted-workspace capability declared and security-sensitive settings gated (siropkin/budi-cursor#45 / PR #49). package.json now declares capabilities.untrustedWorkspaces: { supported: "limited" } with a description listing the keys that get ignored in untrusted folders. extension.ts runs budi.daemonUrl, budi.cloudEndpoint, and budi.pollingIntervalMs through a readSecuritySensitive helper that falls back to the user-scoped (or default) value when vscode.workspace.isTrusted is false. Workspace overrides become effective without an editor reload once the user trusts the folder via onDidGrantWorkspaceTrust. Platform-level companion to the per-setting allow-lists in #42/#43 — the trust gate is enforced in code rather than relying on the user-overridable VS Code declaration alone.

Notes

  • No daemon contract change. ?surface=<host> is additive; an old daemon ignores it and returns the same shape it always did. Single-host v1.4.x calls remain byte-identical when includeOtherSurfaces=false (the default) and the extension already filters to a single surface.
  • Status-bar copy gains exactly one new state — budi · update needed for stale daemons. The other four states (budi, budi · setup, budi · offline, budi · $X 1d · $Y 7d · $Z 30d) are unchanged.
  • The four security fixes are no-ops in the trusted single-developer-workspace flow that has been the default to date; they exist to make the "I just opened an unfamiliar repo" path safe rather than to change shipped behavior for existing installs.