Commit c04372a
fix(agents): prevent path traversal in AgentTool config_path resolution
Absolute config_path values were accepted unconditionally, and relative
paths were joined without boundary validation, allowing traversal outside
the agent directory via "../../../etc/passwd" style inputs.
Fix: reject absolute paths; for relative paths, verify the normalized
result stays within the parent agent's directory before loading.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 7e61b51 commit c04372a
1 file changed
Lines changed: 14 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
167 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| |||
0 commit comments