4 Commits
Author SHA1 Message Date
Isaac ConnorandClaude Opus 4.8 5aeb40c98c fix: enforce per-monitor ACL on EventData and Tags API controllers
EventDataController and TagsController both authorized only with the
account-wide Events permission in beforeFilter() (Events != None) and
never applied the per-monitor ACL that EventsController resolves via
unviewableMonitorIds()/viewableMonitorIds(). A monitor-restricted account
could therefore read data belonging to cameras it is explicitly denied.

EventDataController::index() and ::view() now filter on Event_Data.MonitorId
(the table carries its own MonitorId, so the restriction applies directly,
mirroring EventsController's Event.MonitorId filter). ::view() returns 403
when the row exists but is outside the caller's allowed monitors, matching
EventsController. ::edit() and ::delete() now go through requireEventDataEdit(),
which requires Events=Edit plus the per-monitor ACL on the target row, so a
restricted or view-only account cannot mutate or delete another monitor's
event data by Id. The pre-existing view/edit reads also stop hardcoding a
"Event_Data." alias prefix that does not match the model alias, using
$this->EventData->alias instead.

TagsController exposes per-monitor data only where a tag is joined to its
events: index() filtered by Events.Id (returns Events_Tags.EventId) and
associations() (contains each tag's Events). Both now restrict the joined
Events to viewable monitors when the caller is monitor-restricted. The plain
tag list is a global label vocabulary shared across monitors and is left
unrestricted so restricted users can still tag their own events.

This is the same defect class as GHSA-mg2g-jmfc-3w8g (FramesController),
reported here as GHSA-rgwp-wvjw-6925 for EventDataController; the Tags
controller was found to share the shape during the audit the report
suggested.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 07:33:07 -04:00
stefan 1bd9def63e [API] Fix User variable from array to object
Fix $user variable from array to object to make API work again.
2023-04-23 22:07:24 +02:00
Isaac Connor 46fcd79881 Add authentication and fixups to EventDataController.php 2022-10-27 16:59:18 -04:00
Isaac Connor 6d073119cb Rough in views for EventData 2022-10-27 16:57:05 -04:00