Skip to content

fix: device path validation, edit safety, Unicode NFC normalization, glob/grep security#31896

Closed
LifetimeVip wants to merge 4 commits into
anomalyco:devfrom
LifetimeVip:fix/tool-safety
Closed

fix: device path validation, edit safety, Unicode NFC normalization, glob/grep security#31896
LifetimeVip wants to merge 4 commits into
anomalyco:devfrom
LifetimeVip:fix/tool-safety

Conversation

@LifetimeVip

@LifetimeVip LifetimeVip commented Jun 11, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #31767 #31768 #31784 #31785 #31786

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fix Win32 device path acceptance, edit isDisproportionateMatch safety bypass, Unicode NFC normalization on macOS, V2 glob/grep path traversal, and misleading write.txt/edit.txt tool descriptions.

How did you verify your code works?

Tested in custom fork, verified device paths rejected and Unicode matching works cross-platform.

Screenshots / recordings

N/A - logic change, not UI

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…31786 Unicode normalization

- location-mutation.ts: reject Win32 device paths and /dev/ paths
- edit.ts (V1): remove isDisproportionateMatch single-line bypass
- edit.ts (V1+V2): normalize content to NFC before matching
#31680 - tool.execute.before: capture hook output so plugin arg mutation takes effect
#31679 - permission parser: skip variable-only commands (\)
#31651 - apply_patch: add NFC normalization pass for Unicode canonical equivalence
…mate

- write.txt/edit.txt: remove false 'read first or fail' claims
- glob.ts/grep.ts: add path traversal protection + default 100 limit
- token.ts: CJK-aware token estimation (1 token per CJK char)
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@LifetimeVip

Copy link
Copy Markdown
Author

@thdxr @jlongster @rekram1-node @simonklee @Hona these 8 PRs together fix 30 open issues (compaction context loss, Windows encoding, tool error handling, security, etc.). All are mergeable with no conflicts. Would appreciate a review when you have time.

@simonklee simonklee closed this Jun 11, 2026
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.

[BUG] V2 glob/grep tools missing path traversal protection and default result limit

2 participants