Commit e3742bb
committed
fix(security): ReportRenderJob — refuse 'admin' fallback + reject traversal in filesFolder
Two converging persistence-shaped issues:
1. `writeToFiles()` defaulted the dashboard owner to the literal string
`'admin'` when `$dashboard->getOwner()` was null, then wrote
attacker-controlled bytes into `admin`'s home folder. Combined with
NC's link-share endpoints, that's a re-anchor for re-compromise.
2. `$delivery['filesFolder']` is taken straight from the dashboard
payload — user-controlled JSON — with no validation. The job runs
as the dashboard owner (not the user who configured the schedule),
so the configurer effectively borrows owner-fs permissions.
Fixes:
- Skip delivery (with a warning log) when owner is null/empty rather
than falling back to admin.
- Reject folder paths containing `..` (traversal) or that resolve to
empty after stripping leading slashes.
Persisting a separate `configurer` UID and validating the folder
against an allowlist of paths the *configurer* explicitly owns is the
right longer-term fix — left as a follow-up so this commit stays
small.
Refs: #1419 review (blocker 7) — discussion_r31874944441 parent e1ba44c commit e3742bb
1 file changed
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
275 | 290 | | |
276 | 291 | | |
277 | 292 | | |
| |||
288 | 303 | | |
289 | 304 | | |
290 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
291 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
292 | 320 | | |
293 | 321 | | |
294 | 322 | | |
| |||
0 commit comments