Files
picpeak/backend
Paul Nothaft 1abd42e683 fix(backend): enforce event ownership on short URL deletion (#1394)
Backport of 980a8642a2 from main
(GHSA-9h7q-2jpf-vj85). GET and POST for an event's short URLs both
required requireEventOwnership; DELETE only checked events.edit
permission, letting any admin holding that permission delete another
tenant's branded gallery short URL. Resolve the short URL's event
first, then apply the same ownership check the other routes use.

Adapted for stable: main's ownership guard uses a canAccessEvent(admin,
event) helper factored out of middleware/ownership.js that doesn't
exist on this older branch. Inlined the equivalent predicate directly
(the same "no owner, or admin owns it" check requireEventOwnership
itself uses here) instead of adding the helper.

Co-authored-by: Paul Nothaft <paul@MacStudio-von-Paul.local>
2026-09-11 11:21:38 +02:00
..