ajax/frames.php task=query checked the global canView('Events') and then
built the Frames query from the request event id alone, without the
per-event check its siblings make. A user with Events=View but a monitor
permission of None on an event's monitor could read that event's frame
records -- frame number, Normal/Alarm type, timestamp, delta and score --
for any event on a denied monitor, learning when activity happened and how
strong the alarm scores were across monitor boundaries. This is the web
copy of the disclosure GHSA-mg2g-jmfc-3w8g fixed in the Frames API;
frame images stay protected by views/image.php.
Construct the event in the sanity block and refuse the request unless
ZM\Event::canView() passes, which enforces the per-monitor permission
through Monitor()->canView(), matching ajax/event.php and the API.
Test tests/php/test_frames_query_requires_view.php includes the real file
with the web helpers stubbed (one child php process per case, as the file
declares queryRequest() at file scope) and asserts the Frames table is
never read for a denied or missing event. 11 checks; 6 fail before the fix.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ajax/frames.php collected Frames.Id values from the event's rows and then
filtered with a FrameId IN (...) term, which FilterTerm translated to
Id IN (...). The search query had no EventId condition of its own. Once
the term matches on FrameId, which is only unique within an event, it
returns rows from every event, so the query is now anchored on the event
with the same WHERE EventId clause as the unfiltered list.
FilterTerm now maps FrameId to the FrameId column. The frames list
thumbnail links address the image by eid and fid instead of Frames.Id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>