Commit cd09e6c
committed
fix: add path traversal validation to save/load datapoints endpoints
User-supplied paths in _save_datapoints and _load_datapoints are passed
directly to file I/O without validation. An attacker can use path
traversal sequences to read or write arbitrary files on the server.
Add _validate_data_path() that resolves the path and ensures it stays
within the configured data_dir.1 parent 3debb60 commit cd09e6c
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
218 | 230 | | |
219 | 231 | | |
220 | 232 | | |
| |||
231 | 243 | | |
232 | 244 | | |
233 | 245 | | |
| 246 | + | |
234 | 247 | | |
235 | 248 | | |
236 | 249 | | |
| |||
249 | 262 | | |
250 | 263 | | |
251 | 264 | | |
| 265 | + | |
252 | 266 | | |
253 | 267 | | |
254 | 268 | | |
| |||
0 commit comments