Skip to content

fix(workspace): enforce file extension whitelist on all writes + block executables (issue #28) - #41

Merged
labtgbot merged 1 commit into
mainfrom
fix/issue-28-extension-enforcement
Jun 15, 2026
Merged

fix(workspace): enforce file extension whitelist on all writes + block executables (issue #28)#41
labtgbot merged 1 commit into
mainfrom
fix/issue-28-extension-enforcement

Conversation

@xdevrobot

Copy link
Copy Markdown
Collaborator

Fixes #28

…k executables (issue #28)

- Add 'text' fileType with safe extensions (.md, .txt, .json, .csv, etc.)
- Make fileType parameter required with 'text' default in validateWritePath
- Add BLOCKED_EXTENSIONS list (.exe, .dll, .bat, .cmd, .sh, .ps1, etc.)
  that is always rejected regardless of fileType
- Add extensionToFileType() helper to auto-detect type from extension
- Update all call sites to pass appropriate fileType:
  - WebUI write endpoint → 'text'
  - Agent workspace_write → auto-detected via extensionToFileType()
  - download-binary → auto-detected from filename extension
  - download-media → auto-detected from filename extension
- Update validator tests: 79 tests covering blocked extensions,
  default text enforcement, and fileType-specific validation

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@labtgbot
labtgbot merged commit 815f182 into main Jun 15, 2026
17 checks passed
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.

[MEDIUM] validateWritePath extension check is optional — agent can write executable files to workspace

2 participants