Skip to content

[SECURITY] Keep preview IaC state paths under operator control on server surfaces #834

Closed

Description

@jeffreyaven

Constituent of #769. Reviewed current main at 1de4135 on 2026-10-08; this issue proposes work, no implementation is included.

CWEs: CWE-73, CWE-22.

Finding and evidence

With the explicit unstable preview opt-in, stackql_preview.iac.run accepts a SQL state predicate. internal/stackql/intrinsic/iac.go uses ApplicationFilesRootPath only when the predicate is absent, then passes the supplied path to omnisdk.Converge. pkg/omnisdk/iac.go creates ledger/journal storage under that path.

The path reaches the filesystem without a server-side base-directory policy. A current-build probe using omnisdk's local widgets fixture and a temporary state directory outside the approot created ledger/probe/.lease.v1.json and the journal directory. It then failed on Windows directory sync; no cloud or mock mutation request occurred. Empty-resource and invalid-address probes failed before opening state and are not valid reproduction payloads. Server reachability is source-traced; this probe used local exec to isolate the filesystem behavior.

Required outcome

  • Make server-side state location operator-owned, or resolve approved logical state names under a configured root. Reject paths escaping that root, including Windows and symlink/junction cases.
  • Preserve a deliberate local CLI override where the operator owns the process.
  • Ensure rejected state paths cause no filesystem or cloud mutation, and document how collections share state.

Validation and acceptance

Use a valid minimal mock provider with unstable preview enabled, run through pgwire and MCP, and test outside-root/absolute/parent/symlink paths plus allowed state names. Assert no outside artifacts or cloud calls for rejected paths. Verify the preview-disabled default remains unavailable.

Scope and related work

Independent of MCP classifying effectful SELECT correctly: even an authorized full_access operation should not choose arbitrary server filesystem locations. This does not claim the stable/default query surface exposes preview IaC.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions