fix(browser): check fs access in builtin commands [backport to v3]#10679
Merged
hi-ogawa merged 4 commits intoJul 1, 2026
Conversation
…cess [backport to v3] Manual backport of the browser command permission gate. v3 only exposes the vulnerable `screenshot` (write) and `upload` (read) commands, so gate those via shared `assertBrowserApiWrite`/`assertBrowserFileAccess` helpers (using v3's `isFileServingAllowed`). Tests follow the v3 `errors-fs` spec style with stderr assertions. Co-authored-by: OpenCode (claude-opus-4-8) <[email protected]>
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
…t to v3] The `onTaskAnnotate` RPC recorded a client-supplied annotation attachment path with no gate. Since attachments are copied into `attachmentsDir`, an arbitrary path (e.g. `/etc/passwd`) could be disclosed regardless of `allowWrite`. Add `checkFileAccess` for the attachment path and strip it when `allowWrite` is disabled. Co-authored-by: OpenCode (claude-opus-4-8) <[email protected]>
hi-ogawa
marked this pull request as ready for review
June 30, 2026 08:41
Member
|
Related tests seem to be failing 🤔 |
…ions [backport to v3] The screenshot command builds its save path with `node:path` normalize, so the "Access denied"/"Cannot modify file" messages use backslashes on Windows while the test compares against forward-slash `pathe` paths. Normalize separators in the assertion so it passes on all platforms. Co-authored-by: OpenCode (claude-opus-4-8) <[email protected]>
sheremet-va
approved these changes
Jul 1, 2026
Member
|
Could we add zizmor to v3? Or should we remove the zizmor requirement from v* branches? Cannot merge this otherwise |
Collaborator
Author
|
I thought we already aligned all. I should include that in: |
Collaborator
Author
|
I can merge now. Merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The fix is only ported for
upload,screenshot,onTaskAnnotatesince other surfaces didn't exist in v3.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.