dragonflight/services/mam-api/src
Zac 3fe7d6bba2 fix(mam-api): close cross-project authz gaps in assets/bins/jobs/upload
Review of the v2 auth landing found four places where the per-project RBAC
helpers weren't applied to destination/source projects, letting a scoped
editor write into projects they don't have access to:

- assets PATCH /🆔 bin_id moved with no check, so an editor in project A
  could stuff their asset into a bin in project B. Now validates the bin's
  project_id matches the asset's own project (assets don't change project).
- assets POST /:id/copy: body's projectId/binId never checked, so any
  reachable asset could be cloned into an arbitrary project. Now asserts
  edit on the destination project and validates binId belongs there.
- bins POST /:id/assets: requireBinEdit checks edit on the bin's project but
  not on the source asset's project, so an asset from project B could be
  pulled into A's bin tree (and surfaced in A's views). Now the asset must
  belong to the bin's own project.
- jobs POST /conform: project_id from body never gated, so any logged-in
  user could enqueue conform jobs against any project. Now asserts edit.
- upload POST /init, POST /simple: projectId/binId from body never gated,
  same class of bug. Now asserts edit on projectId and validates binId.
- upload GET /: returned every in-progress upload globally, leaking
  filenames across projects. Now scoped via accessibleProjectIds.

These are the same pattern as the holes 2615143 closed on recorders/
sequences/imports/comments — these routes existed before the RBAC commit
landed and were never marked TODO(authz), so the broad sweep missed them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 12:52:29 +00:00
..
ampp feat: AMPP folder sync integration — pre-create folder hierarchy on upload, expose lookup endpoint for Script Task: client.js 2026-04-18 13:42:07 -04:00
auth feat(mam-api,web-ui): Google OAuth (OIDC) sign-in 2026-05-30 02:51:59 +00:00
db feat(mam-api,web-ui): Google OAuth (OIDC) sign-in 2026-05-30 02:51:59 +00:00
middleware feat(mam-api,web-ui): TOTP two-factor authentication 2026-05-30 02:42:57 +00:00
routes fix(mam-api): close cross-project authz gaps in assets/bins/jobs/upload 2026-05-30 12:52:29 +00:00
s3 fix(s3): land NodeHttpHandler request/connection timeout in main 2026-05-29 17:26:59 -04:00
tasks Revert "auth: top-to-bottom rework — local accounts, RBAC + client tag, audit log, env-bootstrap" 2026-05-27 03:28:05 +00:00
index.js feat(mam-api,web-ui): Google OAuth (OIDC) sign-in 2026-05-30 02:51:59 +00:00
scheduler.js chore: 1.2 ship-prep sweep — close 38 issues 2026-05-27 02:06:14 +00:00