Skip to content

fix(cli): gate socket.json bazel settings behind --trust-socket-json - #1632

Open
Josh Horecny (hank-sc0rpio) wants to merge 1 commit into
mainfrom
fix/manifest-bazel-socket-json-trust
Open

Josh Horecny (hank-sc0rpio) wants to merge 1 commit into
mainfrom
fix/manifest-bazel-socket-json-trust

Conversation

@hank-sc0rpio

@hank-sc0rpio Josh Horecny (hank-sc0rpio) commented Oct 19, 2026 •

Copy link
Copy Markdown

Summary

socket manifest bazel now handles socket.json the same way the other manifest commands and the manifest auto Bazel path do.

  • Without --trust-socket-json, the command refuses bazel/bin, bazelFlags, bazelRc, and bazelOutputBase from socket.json.
  • An out from socket.json that points outside the project is refused the same way. A path inside the project still works without the flag.
  • Command-line flags (--bazel, --bazel-flags, --bazel-rc, --bazel-output-base, --out) still override socket.json without the trust flag.

Behavior change: if your socket.json sets a Bazel binary or Bazel options, pass --trust-socket-json or pass the matching flags directly.

Tests

  • New unit tests for the trust check: each gated field, the trust flag, command-line overrides, and out inside vs. outside the project.
  • New command tests: without the flag, a socket.json bin never reaches the extractor; with the flag, it is used.

Note

Medium Risk
Changes execution and output-path trust boundaries when scanning untrusted repos; incorrect gating could break legitimate CI configs or weaken protection against malicious socket.json.

Overview
socket manifest bazel now gates repository socket.json defaults behind --trust-socket-json, matching the trust model used elsewhere in manifest generation.

Without the flag, the command refuses defaults.manifest.bazel values that pick what runs (bazel/bin, bazelFlags, bazelRc, bazelOutputBase) and refuses an out path that resolves outside the project cwd. CLI flags still win without trusting the file; in-project out from socket.json remains allowed. Resolution lives in new bazel-socket-json-trust.mts; failures surface via outputManifest instead of silently applying repo-controlled settings.

Behavior change: workflows that relied on socket.json for the Bazel binary or options must pass --trust-socket-json or set the equivalent CLI flags explicitly.

Reviewed by Cursor Bugbot for commit 9ae1d87. Configure here.

socket manifest bazel now treats the scanned repository's socket.json
like the other manifest commands and the auto-manifest bazel path:
bazel/bin, bazelFlags, bazelRc, and bazelOutputBase from socket.json are
refused unless --trust-socket-json is passed, and an out path that
resolves outside the project is refused the same way. Command-line flags
still override socket.json without the trust flag.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant