Skip to content

fix(secrets): allow allowInsecurePath for file providers#40486

Open
AaronWander wants to merge 1 commit intoopenclaw:mainfrom
AaronWander:fix/windows-secrets-file-provider-allow-insecure-path
Open

fix(secrets): allow allowInsecurePath for file providers#40486
AaronWander wants to merge 1 commit intoopenclaw:mainfrom
AaronWander:fix/windows-secrets-file-provider-allow-insecure-path

Conversation

@AaronWander
Copy link
Copy Markdown
Contributor

Summary

  • Problem: Windows CI test shard fails in src/secrets/runtime.test.ts with ACL verification unavailable on Windows for temp-file secret providers, because file secret providers cannot opt out of strict path ACL verification.
  • Why it matters: This breaks CI on main and causes unrelated PRs to fail and block merges.
  • What changed: File secret providers now accept allowInsecurePath?: boolean (schema + types); the resolver passes it through to the secure-path audit; the secrets runtime tests enable it on Windows for temp-home secret files.
  • What did NOT change (scope boundary): Default behavior remains strict; symlink restrictions and other path validation remain unchanged; no runtime behavior changes unless users explicitly set allowInsecurePath: true.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

  • File secret providers may now set allowInsecurePath: true to bypass path permission/ACL verification when the path is trusted (notably when Windows ACL verification is unavailable).

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS (local)
  • Runtime/container: Node 22 + pnpm
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted): N/A

Steps

  1. On Windows CI, run pnpm test (sharded).
  2. Observe src/secrets/runtime.test.ts failing with ACL verification unavailable on Windows ... Set allowInsecurePath=true ....

Expected

  • Windows test shards should not fail due to ACL-audit unavailability when the secrets file path is trusted and explicitly opted out.

Actual

  • Before fix: file secret providers cannot set allowInsecurePath, so the secure-path audit fails when ACL verification is unavailable.

Evidence

Human Verification (required)

What you personally verified (not just CI), and how:

Verified scenarios:

  • pnpm tsgo
  • pnpm exec vitest run src/secrets/runtime.test.ts

What you did not verify:

  • Running the Windows CI matrix locally.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Failure Recovery (if this breaks)

  • Revert this commit to remove the new allowInsecurePath option for file secret providers.

Risks and Mitigations

Risk:

  • Users could opt out of path permission checks for file secret providers.

Mitigation:

  • The bypass is explicit (allowInsecurePath: true) and defaults to strict behavior.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 9, 2026

Greptile Summary

This PR fixes a Windows CI shard failure in src/secrets/runtime.test.ts by extending the existing allowInsecurePath escape hatch — already present on exec secret providers — to file secret providers as well. The change threads through the Zod schema, the TypeScript type, and the resolver, and updates the two affected test cases to conditionally opt out of ACL verification only on Windows where it is unavailable.

  • Schema & type: allowInsecurePath?: boolean added to SecretsFileProviderSchema and FileSecretProviderConfig, consistent with the identical field already present on ExecSecretProviderConfig.
  • Resolver: readFileProviderPayload now forwards providerConfig.allowInsecurePath to assertSecurePath, which already supported the flag — symlink and absolute-path enforcement remain unchanged.
  • Tests: The two runtime snapshot test cases that create temp-file secret providers conditionally enable allowInsecurePath: true on process.platform === "win32" to prevent the ACL verification unavailable on Windows failure; non-Windows paths remain unaffected.
  • Default behavior: Unchanged — the flag is strictly opt-in, and all security guards (symlink rejection, absolute-path requirement) continue to apply regardless of the flag value.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, well-scoped bug fix that wires up an already-implemented and tested escape hatch to a second provider type.
  • All five changed files make targeted, internally consistent changes. The assertSecurePath function already handled allowInsecurePath correctly; this PR simply exposes the option at the file provider level. Default behavior is strictly unchanged, the flag is explicit opt-in, and the test changes are conservatively scoped to Windows only. No logic was restructured and no new execution paths were introduced.
  • No files require special attention.

Last reviewed commit: 7d9a3c2

@AlexAnys
Copy link
Copy Markdown

AlexAnys commented Mar 9, 2026

This looks like it fixes the current Windows CI failure (SecretProviderResolutionError: ... ACL verification unavailable on Windows ... Set allowInsecurePath=true).

In particular, threading allowInsecurePath through FileSecretProviderConfig + assertSecurePath, and setting it in src/secrets/runtime.test.ts for win32, should unblock checks-windows shard runs.

Thanks for tackling this — seems worth merging to get main green again.

@Takhoffman Takhoffman requested a review from a team as a code owner March 24, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants