Repository navigation
Commit 382c7b5
committed
Enhance path sanitization to normalize and block git directory variations
- Update `apps/editor/src/utils/path-sanitizer.ts` to prevent RCE via git config overrides by making the `.git` segment check in `sanitize_file_name` case-insensitive while stripping trailing dots/spaces, and update `create_safe_path` to strictly reject any `realpath` that contains a `.git` directory.
└── apps
└── editor
└── src
├── commands
│ ├── apply-response-command
│ │ ├── apply-response-command.ts
│ │ ├── response-processor
│ │ │ └── handlers
│ │ │ └── diff-handler.ts
│ │ └── utils
│ │ └── file-operations
│ │ └── create-file-if-needed.ts
│ ├── generate-commit-message-commands
│ │ └── actions
│ │ └── run-generate-action.ts
│ └── history-command
│ ├── actions
│ │ └── restore-checkpoint.ts
│ └── history-command.ts
├── features
│ └── checkpoints
│ ├── actions
│ │ └── create-checkpoint.ts
│ └── utils
│ ├── copy-optimised-recursively.ts
│ └── git-utils.ts
└── utils
├── normalize-path.ts
└── path-sanitizer.ts1 parent 1a2a9dd commit 382c7b5
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
58 | 73 | | |
59 | 74 | | |
60 | 75 | | |
| |||
0 commit comments