Commit Graph
30103 Commits
Author SHA1 Message Date
Jash ff052d5c68 perf: build zm_zone.cpp with gcc's dynamic vector cost model so motion detection vectorizes at -O2, fixes #5482 2026-11-08 15:37:41 +05:30
Isaac Connor 8556830515 Merge pull request #5473 from connortechnology/fix/ghsa-9hf5-export-traversal
fix: path traversal in event-export write path (GHSA-9hf5-jpww-rvpp)
2026-11-07 18:29:09 -05:00
Isaac ConnorandClaude Opus 4.8 bf04cfe04c fix: refuse a path-traversal export name in exportEvents/downloadEvents refs GHSA-9hf5-jpww-rvpp
The export-generation path sanitized the user-supplied export directory name with
preg_replace('/[^\w\-.]/', '', ...), a whitelist that keeps dots, so a bare '..'
survived and $export_root became the parent of the export root. exportEvents()
then chmod'd, wrote into, and tarred that parent, and the archive was downloadable
through the safeExportComponent() read guard because it genuinely sat in the
exports dir. downloadEvents() had the same shape via DIR_EXPORTS_DOWNLOAD
(refs GHSA-72h2-rvhv-wr5g).

These are residual siblings of GHSA-fvx4-86xp-9v22, which hardened the download/
read views but left the write path. Refuse a '.'/'..' component in exportEvents(),
and route downloadEvents()'s name through the existing safeExportComponent().

Add tests/php/test_export_path_traversal.php.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-07 10:54:46 -05:00
Isaac Connor 744495f59d Merge pull request #5471 from connortechnology/fix/ghsa-xqfr-filter-allowlist-sweep
fix: pass a field allow-list at every API buildFilter call site (GHSA-xqfr-6v9x-cvwc follow-up)
2026-11-07 10:47:51 -05:00
Isaac ConnorandClaude Opus 4.8 dd2a658b31 fix: add the field allow-list to ServerStatsController too refs GHSA-xqfr-6v9x-cvwc
Completes the previous commit, which omitted this one call site.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-07 10:28:53 -05:00
Isaac ConnorandClaude Opus 4.8 71cae39ed9 fix: pass a field allow-list at every API buildFilter call site refs GHSA-xqfr-6v9x-cvwc
Follow-up to the numeric field-name guard. FilterComponent::buildFilter() takes
an optional $validFields allow-list, but only EventsController's search index
and MonitorsController (via qualifyFields) used it; the other index/search/
consoleEvents call sites passed none, so a field name was checked only by the
character class, not against a known column set.

Pass array_keys($this->Model->schema()) - the pattern EventsController already
uses - at the remaining sites across Configs, EventData, Events (three), Frames,
Groups, ServerStats, Snapshots, Storage, Tags and UserPreference, so a field
must be a real column of the queried model and an unknown field is a 400 rather
than a MySQL 500. The injection itself is already closed by the numeric
field-name guard; this is defense in depth and consistent error handling.

ServerStatsController's commented-out permission check is left as-is (clients
need the data to render monitors); only the allow-list is added there.

Add tests/php/test_api_filter_fields_enforced.php.

Reported by arpitjain099.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-07 10:27:31 -05:00
Isaac Connor 5da0ec0d57 Merge pull request #5468 from connortechnology/fix/ghsa-xqfr-filter-numeric-field
fix: reject all-digit API filter field names in FilterComponent (GHSA-xqfr-6v9x-cvwc)
2026-11-07 10:09:35 -05:00
Isaac ConnorandClaude Opus 4.8 71996d18b6 fix: reject all-digit API filter field names in FilterComponent refs GHSA-xqfr-6v9x-cvwc
A named parameter written `0:<payload>` reaches FilterComponent::buildFilter()
as an integer array key, and the field regex `[a-z0-9.]+` matched the all-digit
name, so `$conditions["0"] = $value` cast the key to an int. CakePHP 2.x renders
an integer-keyed condition as a raw, unescaped SQL fragment, so the value went
into the WHERE clause verbatim (UNION exfiltration, ACL bypass via a trailing
comment, blind boolean oracle) at the index() call sites that pass no
$validFields allow-list.

Refuse an all-digit field name in buildFilter(), so every key that reaches
$conditions contains a letter or a dot and stays a string key that CakePHP
quotes. Add tests/php/test_api_filter_numeric_field.php.

Reported by arpitjain099.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-07 10:01:11 -05:00
Isaac Connor 05081ce635 Merge pull request #5322 from connortechnology/5186-zms-ui-next-event
fix: let the UI tell zms which event is next/prev for gapless playback
2026-11-06 18:49:12 -05:00
Isaac ConnorandClaude Opus 5.5 2d4605ef11 fix: look up neighbours again while zms is paused refs #4186
When the next event the page sent has been deleted, zms stops at the end of
the current event. The page only asked again about a 0 boundary, so it kept the
deleted neighbour and zms stayed paused. Ask again every BOUNDARY_REFRESH_MS
while zms reports paused; a different answer is sent and resumes it through
HintResumes. A user's pause is unaffected, since zms only resumes after
stopping at the end of the filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 20:18:13 -05:00
Isaac ConnorandClaude Opus 5.5 63b77eb001 fix: keep the event view's controls and size right when zms changes monitor refs #4186
On the zms path the page can move on to another monitor's event without a page
load, but its elements and PanZoom are built for the monitor it was loaded for.
Looking them up by eventData.MonitorId found nothing after such a change: the
scale timer threw on panZoom[id].getScale(), the zoom buttons stopped showing,
and the stream element was not found. Look them up by domMonitorId(), the
monitor the page was loaded for.

The image also kept the first monitor's size and zms its scale. When the new
event's frames are another size, run changeScale() again. The zones drawn are
the page's monitor's, so hide them and disable the toggle over another
monitor's event, and put them back as they were on returning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 20:18:13 -05:00
Isaac ConnorandClaude Opus 5.5 2993404c88 fix: restart zms on the event it was playing refs #4186
restartZmsStream reloaded the stream image's original URL, which names the
event the page was opened on. zms moves on by itself, now across monitors, so
recovering from a broken stream started playback over from that first event.
Restart on the last event zms reported, without the first event's frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:55:35 -05:00
Isaac ConnorandClaude Opus 5.5 954b14a728 fix: fit frames of another shape inside the stream instead of stretching refs #4186
The MPEG encoder's size is set by the stream's first frame. When playback moved
on to an event from a monitor with another aspect ratio, PackImage scaled its
frames to that size and distorted them. Scale them to fit inside it, centred on
black, with even sizes and offsets so subsampled chroma stays aligned. The black
fill is done by hand because av_image_fill_black needs FFmpeg 4.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:55:35 -05:00
Isaac Connor 1c7b089eb2 Merge commit from fork
fix(api): refuse events/view for an event on a monitor the user may not view (GHSA-3m5x-32ch-gg29)
2026-11-05 18:42:58 -05:00
Isaac ConnorandClaude Opus 5.5 234996a0ea fix: drop the reply to a neighbour lookup that was retried refs #4186
A lookup given up on after LOOKUP_TIMEOUT_MS is retried while the first may
still answer. If the first answered last, its older neighbours replaced the
retry's: a stale 0 disabled Next and sent zms a boundary. Number the lookups
and apply only the reply to the last one; only its completion ends the wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:45:56 -05:00
Isaac ConnorandClaude Opus 5.5 4ff9e0c98f fix: try the packed layout when the 32-byte one does not fit the image refs #4186
A packed planar frame whose width is a multiple of 32, such as 32x16 YUV420P,
has the same luma stride as the 32-byte layout, so PackImage picked that layout
and then refused the image because it needs more bytes than the frame has. The
frame was dropped. Accept a layout only if it also fits Size(), so the packed
one is tried next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:45:56 -05:00
Isaac ConnorandClaude Opus 5.5 07844a935e fix: keep hints in order and let a late one restart a stopped stream refs #4186
Each hint is its own request, so two sends for the same event, such as a
boundary 0 and then the event found by the refresh, could reach zms out of
order and leave it with the older one. The page now waits for the replies to
one send before starting the next; a zms restart drops that wait, since the
old commands went to the old process.

When zms stopped at the end of an event because the filter had nothing
further, or the hint came too late, a hint arriving afterwards was stored but
playback stayed paused, so an event recorded since was never played. A
SET_EVENT that names an event in the direction we stopped in now resumes
through the end-of-event wait, unless a user command came in between.

Give up on an unanswered neighbour lookup after 5s rather than 10s, so a
retry still arrives within zms's 10s wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:30:56 -05:00
Isaac ConnorandClaude Opus 5.5 643296bf07 fix: keep the zoom crop when playback moves to a different resolution refs #4186
prepareImage keeps last_crop in the pixels of the frame it was computed for.
When event playback moves to a monitor with another resolution, the old crop
was applied to the new frame, so the zoomed area jumped or Crop refused it.
Record the frame size the crop belongs to and rescale the crop when it changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:30:56 -05:00
Isaac ConnorandClaude Opus 5.5 d30739272e fix: map an Image's rows at its own stride when packing for the encoder refs #4186
PackImage assumed every Image has 32-byte-aligned rows. An Image that wraps a
caller's buffer is packed (width * colours), and one wrapping an AVFrame keeps
the frame's stride, so mapping them on a 32-byte stride read the wrong rows
and ran past the end of the buffer. Use LineSize() for packed formats, match it
against the 32-byte or packed layout for planar ones, and refuse a mapping
larger than Size().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:30:56 -05:00
Isaac ConnorandClaude Opus 5.5 150d7de86e fix: number hint sends and retry failed neighbour lookups refs #4186
Replies to CMD_SET_EVENT named only the source event, so after a boundary
refresh or a zms restart the replies to an earlier send for the same event
could mark the later one delivered and stop its retries. Number each send and
match replies by that number; reset() drops the number so replies to the old
zms no longer count.

If the neighbour lookup after an event change failed, the page kept the
previous event's neighbours and never asked again, so zms waited at the end
of the event and stopped. Track the lookup: look up the playing event's
neighbours when there are none for it, one request at a time, retrying a
failed one after 2s and giving up on an unanswered one after 10s. This also
replaces the separate boundary refresh bookkeeping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 22:05:35 -05:00
Isaac ConnorandClaude Opus 5.5 f14eb35ae4 fix: read the hint wait under the lock and keep forceEventChange for the load refs #4186
runStream read hint_wait_start after releasing the mutex to decide whether an
MPEG stream should sleep, while the command thread can clear it. Take one
snapshot of the wait state under the mutex and use it for the whole iteration.

checkEventLoaded cleared forceEventChange before loadEventData, which only
moves curr_stream_time to the new event while the flag is set. An explicit
next/prev in MODE_ALL then counted down through the recording gap instead of
jumping. Clear it after loading, and on the path where there is nothing to load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 22:05:35 -05:00
Isaac ConnorandClaude Opus 5.5 2552d54cc9 fix: deliver the event view's next/prev hints to zms reliably refs #4186
The page sent its two SET_EVENT commands once, as soon as its
neighbours query returned:

- On page load that is often before zms has opened its socket. The
  command then failed with no_socket, getCmdResponse marked zms broken,
  and status polling stopped, so later event changes were never seen.
- A restarted zms (restartZmsStream) never got them.
- After zms moved to a new event, the neighbours query waited for
  eventQuery to return first, adding a round trip before zms could
  learn what follows.
- A "no next event" answer was kept for the whole event, so an event
  recorded after the page asked was never played.

event-zms-hints.js now tracks the hints: they go out after zms answers a
status query for their event, are resent if they did not reach zms or
zms restarts, and a boundary in the direction of play is asked for again
every 5s. They are sent with their own handler, so a failure never marks
zms broken. The page asks for the new event's neighbours as soon as zms
reports it, alongside eventQuery, and drops a neighbours reply for an
event zms has already left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:32:53 -05:00
Isaac ConnorandClaude Opus 5.5 ef29de86d4 fix: check SET_EVENT ids before authorising and packing them refs #4186
stream.php checked the target event's permission using the request
string and then packed intval() of it. On 32-bit PHP intval('2147483648')
is 2147483647, so the check and zms could see different events, and a
non-numeric or array value was cast to whatever intval() made of it.

The ids now have to be digit strings that fit in this PHP's int, or the
request is refused. The checked int is what gets packed. The packing
moved to includes/stream_set_event.php so tests/php can check the bytes
against EventStream::DecodeSetEvent's layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:32:53 -05:00
Isaac ConnorandClaude Opus 5.5 fc8791e52a fix: wait for the UI's next event in zms and encode any frame safely refs #4186
Gapless playback over zms follows the next/prev events the event view
sends with CMD_SET_EVENT. Reviewing the first version found these gaps:

- An event that ended before the UI's hint for it arrived fell back to
  zms's same-monitor query and skipped the other monitors' events again.
  The page needs a status poll and two requests to send that hint, and
  at 10x a ten second event lasts one second. Once a UI has sent any
  hint (ui_managed) zms never uses the same-monitor query: it holds on
  the last frame, like a pause, until the hint arrives, and stops after
  kHintWait (10s) if none does. Streams with no UI behave as before.
  The choice is EventStream::ChooseNeighbour, a static so it is tested.
- A hinted event deleted since the UI found it fell back to the
  same-monitor query, leaving the filter. It now stops there, as
  stream.php already does for a target deleted before forwarding.
- MPEG streams copied each frame into encoder buffers sized for the
  first frame's dimensions, format and packed stride. Text frames are
  drawn in the monitor's colours (usually RGB32) while event frames are
  RGB24, a frame from another monitor can be larger, and Image rows are
  padded to 32 bytes, so all three overran those buffers. The scaling
  added to StreamBase only handled size, and the live stream never set
  the tracked size. VideoStream::EncodeImage now converts any Image to
  the encoder's own size, format and stride with sws_scale, and every
  MPEG path uses it; the tracking in StreamBase is gone.
- loadEventData kept the previous event's video decoder when the new
  event had none, so a missing jpeg showed the previous camera's frame
  under the new event. It now drops it.
- The MPEG path only read jpegs, so an event recorded as video only
  streamed nothing. Both paths now take frames from loadFrameImage,
  which falls back to the event's video as the jpeg path already did.

tests/zm_eventstream_hints.cpp covers the message decoding, which hint
applies to which event, ChooseNeighbour (including Id order
10(M1) 11(M2) 12(M1) 13(M2), which went 11 -> 13) and PackImage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:32:53 -05:00
Isaac Connor b05d122aee Merge pull request #5461 from connortechnology/ffmpeg-options-syntax
fix: check the ffmpeg Options field syntax before saving a monitor
2026-11-04 18:58:56 -05:00
Isaac Connor 42706741d3 Merge remote-tracking branch 'upstream/master' into 5186-zms-ui-next-event 2026-11-04 18:41:28 -05:00
Isaac ConnorandClaude Opus 5.5 44e0cc0442 fix: log unparseable ffmpeg Options as an Error with the expected syntax
zmc drops the Options field when av_dict_parse_string() fails, so the
camera runs without them. Raise the message from Warning to Error and say
that options are key=value pairs, not command line flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 18:30:49 -05:00
Isaac ConnorandClaude Opus 5.5 161a979673 fix: check the ffmpeg Options field syntax before saving a monitor
The Options field takes key=value pairs, but people copy ffmpeg command
line flags into it, such as -tls_verify 0 to accept an rtsps camera's
self-signed certificate now that ffmpeg 9 verifies by default. zmc then
logs that it could not parse the options and drops them.

monitor-ffmpeg-options.js ports av_dict_parse_string() and av_get_token()
so the form reports the entry ffmpeg would stop at. It also reports keys
that parse but can name no option: a leading dash, or whitespace or a
separator inside the key, which is what "a=1,tls_verify 0,b=2" turns into.
The help text now spells out the key=value form with tls_verify=0 as an
example.

The expected results in tests/js/ffmpeg-options.test.js were taken from
libavutil 61.1.102 on the same strings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 18:30:49 -05:00
Isaac Connor cde2c7198c Merge pull request #5458 from connortechnology/fix-shareddata-abi-check
fix: teach the SharedData ABI check about SharedValue members
2026-11-04 18:13:56 -05:00
Isaac ConnorandClaude Opus 5.5 cadf43f860 fix: teach the SharedData ABI check about SharedValue members refs #5238
#5444 declared SharedData's scalar members as SharedValue<T>. The ABI
check lifts the struct body out of zm_monitor.h into a standalone probe,
but not the SharedValue template, so those members failed to compile and
dropped out. The probe came to 768 bytes and the size and control_state
offset asserts failed at -m64, which made the CI Build Warnings job fail
on every master PR. The "does not name a type" errors were not printed,
because only the static assert lines were.

Copy the SharedValue template and its static_asserts into the probe,
recognise SharedValue<type> members, and print every compiler error when
the probe fails to build.

Checked against the current header (888 bytes, 52 members, the same
count as before #5444), the header before #5444 (also passes), and a
header with capture_fps back to a plain double and epadding1 removed
(fails at -m32 with capture_fps at 20).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 08:42:28 -05:00
Isaac Connor ee9fefd267 Merge pull request #5455 from connortechnology/fix/ghsa-5w6w-revoke-tokens-master
fix: revoke API tokens when a user's password is changed (GHSA-5w6w-qp25-2qqh)
2026-11-04 08:40:04 -05:00
Isaac Connor 474c2af09e Merge pull request #5449 from IgorA100/patch-763131
Chore: Improved the display of the Monitor page’s "Viewing" tab (for both standard and narrow screens)
2026-11-04 08:27:25 -05:00
Isaac ConnorandClaude Opus 4.8 05a610a2c6 fix: revoke API tokens when a user's password is changed
Changing a user's password rewrote only the password hash and left the
user's JWT API tokens valid: a pre-change access token kept working and a
pre-change refresh token kept minting new access tokens for up to its 24
hour lifetime, so a leaked token survived the password change meant to
cut it off.

Set TokenMinExpiry to the change time in the same step that rewrites the
hash, so validateToken() rejects every token issued before the change,
matching the options page's existing revoke action. Covered paths: the
REST API User model (beforeSave), with the self-edit controller whitelist
widened to persist the field, and the classic web UI user action for both
the administrator edit and the self edit. The login-time upgrade of a
legacy hash to bcrypt rewrites the same password and is left untouched so
it does not revoke tokens.

refs GHSA-5w6w-qp25-2qqh

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-04 08:26:38 -05:00
Isaac Connor de56f33f0b Merge pull request #5453 from connortechnology/5237-capture-failure-ring
fix: leave the image ring to the decoder when capture fails
2026-11-03 22:20:30 -05:00
Isaac ConnorandClaude Opus 5.5 36e3e7cba4 fix: leave the image ring to the decoder when capture fails fixes #5237
When camera->Capture() failed, Monitor::Capture() painted a frame of the
signal check colour into the shared image ring and moved
last_write_index, while the decoder thread could still be writing the
same ring. Capture picked its slot from image_count and the decoder from
last_write_index + 1, so the two could write one slot, giving a viewer a
torn frame, or move last_write_index backwards.

With a decoder thread running, the failure path now only sets
signal = false and leaves the ring to the decoder. Viewers keep its last
frame until the reconnect. That frame was short-lived anyway: zmc closes
the monitor and reconnects straight after the failure, and connect()
clears the ring. The decoder still runs CheckSignal on every decoded
frame, so a capture card's no-signal colour is still detected. With
decoding off nothing else writes the ring, so the signal colour frame is
still written there.

The test drives Capture() with a camera that always fails: with a
decoder the ring, last_write_index and image_count are unchanged;
without one the frame goes into image_count's slot as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:43:41 -05:00
Isaac Connor 67aae52323 Merge pull request #5450 from IgorA100/patch-958040
Add Russian translations for various features
2026-11-03 18:28:37 -05:00
IgorA100 348b19b608 Add Russian translations for various features 2026-11-04 00:56:04 +03:00
IgorA100 cb9ac8a595 Improved the display of the Monitor page’s "Viewing" tab (for both standard and narrow screens) 2026-11-03 23:19:18 +03:00
Isaac Connor 836ec3b6c3 Merge pull request #5444 from connortechnology/5238-shareddata-atomic
fix: access SharedData fields as relaxed atomics
2026-11-03 08:49:59 -05:00
Isaac ConnorandClaude Opus 5.5 d9a629bcda fix: access SharedData fields as relaxed atomics fixes #5238
zmc's capture, decoder and analysis threads, zms, zmu and the web
interface read and write Monitor::SharedData while the others run, but
its scalar fields were plain members. ThreadSanitizer reported races on
capture_fps, state and analysing, and the action word was worse: zmu
sets bits with |= while zmc clears others with &=, and as plain
read-modify-writes either side could write back a word read before the
other's change and drop its bit.

Wrap every scalar SharedData field in SharedValue<T>, which holds only
the value and does each access as a relaxed __atomic builtin (C++17 has
no std::atomic_ref). Loads and stores keep their meaning, |=, &= and ++
become single atomic operations, and copying one field to another is
deleted because it would not be atomic. The layout Memory.pm and
Monitor.php read is unchanged: the 8-byte fields are aligned to 8 so
clang on i386 doesn't call libatomic, and they already sat on 8-byte
offsets. Values passed through printf-style varargs now call load(),
which -Wformat found. MonitorLink's SharedData pointer drops volatile,
which the atomics replace.

The test checks every field offset against Monitor.php, that the
wrapper reads and writes the plain value, and that setting and clearing
action bits from two threads loses none (plain fields lost 3 to 33 of
200000 rounds here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 08:47:05 -05:00
Isaac Connor 3fb6f0d8af Merge pull request #5439 from connortechnology/remove-fast-delete
refactor: remove ZM_OPT_FAST_DELETE
2026-11-03 08:34:19 -05:00
Isaac Connor 2660411af1 Merge branch 'master' into remove-fast-delete 2026-11-03 08:32:58 -05:00
Isaac ConnorandClaude Opus 5.5 9e3885e8fd refactor: remove ZM_OPT_FAST_DELETE
With fast deletes on, deleting an event in the web interface removed only
its Events row and left its Frames and Stats rows and its files for
zmaudit, and deleting a monitor left all of its events. zmaudit only runs
when ZM_RUN_AUDIT is on, and both options default to off independently,
so with fast deletes on and the audit off nothing ever removed them and
the Frames table grew without bound. In the Perl Event::delete the option
also kept zmfilter from removing the files of the events it purged.

Remove the option. ZM\Event::delete() always removes the Stats and Frames
rows and the files in one transaction with the Events row,
ZM\Monitor::destroy() always deletes the monitor's events, and the Perl
Event::delete deletes the files unless the storage area has DoDelete off.
zmupdate.pl rebuilds the Config table from ConfigData, so the option's row
goes away on upgrade without a migration. Drop the option from the docs,
from the zmaudit option help, and from the es_la, ro_ro and ru_ru
translations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 22:50:01 -05:00
Isaac Connor 8a70cb3a86 Merge pull request #5437 from connortechnology/fast-delete-without-audit-warning
fix: warn at start when fast deletes are on and zmaudit is off
2026-11-02 22:47:16 -05:00
Isaac ConnorandClaude Opus 5.5 f47033ec27 fix: warn at start when fast deletes are on and zmaudit is off
With ZM_OPT_FAST_DELETE on, deleting an event in the web interface
removes only its Events row and leaves its Frames and Stats rows and its
files for zmaudit to remove. zmaudit only runs when ZM_RUN_AUDIT is on,
and both options default to off independently, so with fast deletes on
and the audit off nothing ever removes them and the Frames table grows
without bound.

Have zmpkg.pl log one Warning at start for that combination, naming both
options, next to the ZM_AUTH_RELAY=plain warning. Say in the fast delete
option's help that it depends on ZM_RUN_AUDIT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 18:23:03 -05:00
Isaac Connor 9fef3b578a Merge pull request #5344 from IgorA100/patch-278747
Add a setting to enable/disable "backchannel" (a parameter used by Go2RTC) for the monitor.
2026-11-02 18:00:39 -05:00
Isaac Connor c566d738fc Merge pull request #5430 from connortechnology/fix/ghsa-8fj6-frames-canview
fix: require per-event view permission to list an event's frames (GHSA-8fj6-vrj2-vxmr)
2026-11-02 17:59:58 -05:00
Isaac Connor 4eda31b07d Merge pull request #5429 from jayhemnani9910/5416-audit-report-monitor-links
fix: give each event audit report row its own monitor link, fixes #5416
2026-11-02 08:41:10 -05:00
Isaac ConnorandClaude Opus 4.8 28c5f267a7 fix: require per-event view permission to list an event's frames refs GHSA-8fj6-vrj2-vxmr
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>
2026-11-02 08:39:59 -05:00
Isaac Connor 5564970665 Merge pull request #5426 from connortechnology/fix/ghsa-fvx4-export-path-traversal
fix: reject path traversal in export download and archive views (GHSA-fvx4-86xp-9v22)
2026-11-02 08:05:29 -05:00