Repository navigation
Commit 1a2a9dd
committed
Verify real paths in create_safe_path to prevent path traversal
- Update `create_safe_path` to find the deepest existing ancestor of the target path, resolve its `realpath`, and strictly verify it begins with the workspace root's `realpath` plus `path.sep` to prevent symlink escapes.
└── apps
└── editor
└── src
├── commands
│ ├── apply-response-command
│ │ ├── response-processor
│ │ │ ├── handlers
│ │ │ │ ├── diff-handler.ts
│ │ │ │ ├── fast-replace-handler.ts
│ │ │ │ ├── patch-repair-handler.ts
│ │ │ │ ├── restore-preview-handler.ts
│ │ │ │ ├── search-replace-handler.ts
│ │ │ │ └── truncated-handler.ts
│ │ │ └── response-processor.ts
│ │ └── utils
│ │ ├── file-operations
│ │ │ ├── apply-file-relocations.ts
│ │ │ ├── create-file-if-needed.ts
│ │ │ ├── read-rename-source-file.ts
│ │ │ ├── relocate-file.ts
│ │ │ └── undo-files.ts
│ │ └── preview
│ │ ├── build-history-files.ts
│ │ └── file-preparer.ts
│ ├── code-at-cursor-command
│ │ └── code-at-cursor-commands.ts
│ ├── new-file-command.ts
│ ├── new-folder-command.ts
│ └── rename-command.ts
├── utils
│ ├── normalize-path.ts
│ └── path-sanitizer.ts
└── views
└── prompt
└── backend
└── message-handlers
└── handle-patch-repair.ts1 parent e40a144 commit 1a2a9dd
1 file changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
54 | 74 | | |
55 | 75 | | |
56 | 76 | | |
| |||
0 commit comments