Skip to content

fix(camera): fail closed when workspace_only has empty path - #91

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/high-severity-issues-46b6
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/high-severity-issues-46b6

Conversation

@cursor

@cursor cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

Bug and impact

With workspace_only on (default) but workspace_path set to "", camera_capture treated the empty workspace root as “allow all” and wrote caller-supplied JPEG paths anywhere the process can write. write_file already fails closed in the same config.

Concrete trigger (main d367477)

  1. Config: [sandbox] workspace_only = true and workspace_path = "" (or equivalent empty after load).
  2. Hardware enabled (default); agent calls camera_capture with path=/tmp/pwned.jpg (or any absolute path without .. / shell metacharacters).
  3. Capture writes JPEG magic bytes to that host path.

Distinctness

Fix

  • Distinguish set_workspace(NULL) (workspace_only off) from set_workspace("") (enforced, fail closed).
  • tool_hardware_set_config passes "" when workspace_only is on and the path is missing.

Test plan

  • test_empty_workspace_enforced_denies_outside
  • Existing camera workspace / traversal tests
Open in Web View Automation 

path_inside_workspace treated an empty s_workspace as allow-all, so
workspace_only=1 with workspace_path="" let camera_capture write JPEG
bytes anywhere. Match write_file: enforce with empty root denies
caller paths; NULL still disables containment when workspace_only is off.

Co-authored-by: esadrianno <esadrianno@gmail.com>
adriannoes added a commit that referenced this pull request Sep 21, 2026
… paths

workspace_only with an empty root no longer treats every path as allowed.
Dangling symlink capture outputs are rejected instead of creating host
files outside the workspace.

Refs: #91, #90
@adriannoes

Copy link
Copy Markdown
Collaborator

Superseded by #94 (já em development).

@adriannoes adriannoes closed this Sep 21, 2026
@adriannoes
adriannoes deleted the cursor/high-severity-issues-46b6 branch September 22, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants