Skip to content

Conversation

yayami3
Copy link
Contributor

@yayami3 yayami3 commented Sep 9, 2025

Fixes an issue where relative path patterns in agent toolsSettings (e.g., './denied/**') would not match files accessed with different relative path formats (e.g., 'denied/file.txt').

Changes:

  • Enhanced canonicalizes_path() to properly normalize relative paths
  • Added path component resolution for '.' and '..' segments
  • Ensures consistent path matching for both fs_read and fs_write tools

This resolves a security issue where deniedPaths could be bypassed by using different relative path formats.

*Issue #2818

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Fixes an issue where relative path patterns in agent toolsSettings
(e.g., './denied/**') would not match files accessed with different
relative path formats (e.g., 'denied/file.txt').

Changes:
- Enhanced canonicalizes_path() to properly normalize relative paths
- Added path component resolution for '.' and '..' segments
- Ensures consistent path matching for both fs_read and fs_write tools

This resolves a security issue where deniedPaths could be bypassed
by using different relative path formats.
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.

1 participant