Commit 45bbf86
committed
fix(security): rollbackImport — require importer or admin
`POST /api/registers/import/rollback` was `@NoAdminRequired` and the
only safety net was that the downstream `deleteObject` runs RBAC. With
broad delete rights any user could rollback a different user's import
(or a different tenant's, since the audit lookup never filters by org)
just by guessing/learning the job UUID.
Look up the first audit row for the supplied `importJobId`, verify the
caller is either the original importer (`auditRow->getUser()` matches
the current UID) or in the admin group; reject otherwise. 404 when no
audit rows match the job UUID at all.
Refs: #1419 review (blocker 4) — discussion_r31874944301 parent 35aae9f commit 45bbf86
1 file changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1264 | 1264 | | |
1265 | 1265 | | |
1266 | 1266 | | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
1267 | 1304 | | |
1268 | 1305 | | |
1269 | 1306 | | |
| |||
0 commit comments