Commit Graph
14134 Commits
Author SHA1 Message Date
Isaac Connor 985180b79f Merge pull request #5709 from AJ0070/export-mp4-option
fix: honour the mp4 option in the event download modal
2026-11-13 18:18:54 -05:00
Isaac Connor 62100a1fd3 Merge pull request #5711 from AJ0070/export-flat-names
fix: prefix flat export file names so events don't collide
2026-11-13 18:16:49 -05:00
Jash ef2380e683 fix: lock stream commands with flock instead of a leaked SysV semaphore refs #5716 2026-11-13 14:29:33 +05:30
Jash 53454f9d82 fix: use milliseconds for the stream reply timeout refs #5716 2026-11-13 14:29:33 +05:30
Jash 0182c39438 fix: never send stream commands without the connkey lock refs #5716 2026-11-13 14:29:33 +05:30
Jash 4172a62758 fix: prefix flat export file names so events don't collide refs #5710 2026-11-13 14:15:07 +05:30
Jash 31959be5ff fix: send correct content types and attachment disposition for exports refs #5708 2026-11-13 14:15:01 +05:30
Jash adb04f5d33 fix: honour the mp4 option in the event download modal refs #5708 2026-11-13 14:15:01 +05:30
Isaac Connor 55671fcd96 Merge pull request #5553 from AJ0070/5552-janus-pin-shm
perf: read the Janus pin from shared memory instead of running zmu
2026-11-12 19:52:58 -05:00
Isaac Connor 981a5127bd Merge pull request #5606 from AJ0070/5605-delete-storage-diskspace
fix: take a deleted event's DiskSpace off its Storage in the PHP delete
2026-11-12 08:32:39 -05:00
Isaac Connor 7e34c08cca Merge pull request #5597 from AJ0070/5595-snapshots-sql-paging
perf: page the snapshots list in SQL instead of fetching every snapshot
2026-11-12 08:16:55 -05:00
Jash 3f635686a1 fix: take a deleted event's DiskSpace off its Storage in the PHP delete refs #5605 2026-11-12 09:49:11 +05:30
Isaac Connor d34f26d14c Merge pull request #5538 from AJ0070/5537-daemon-check-once
perf: ask zmdc.pl whether ZoneMinder is running once a request
2026-11-11 21:49:14 -05:00
Isaac Connor 45550fea91 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-11-11 21:22:56 -05:00
Jash c1e8f9d453 fix: leave out the WHERE clause in the snapshots list when the search terms give no SQL refs #5595 2026-11-12 06:02:28 +05:30
Jash 01e5acb46f perf: page the snapshots list in SQL instead of fetching every snapshot fixes #5595 2026-11-12 05:46:58 +05:30
Isaac Connor 29a376ba05 Merge pull request #5580 from AJ0070/5579-api-group-edit
fix: use the Group model when an API group edit fails validation
2026-11-11 19:11:34 -05:00
Isaac Connor 62939ae9d8 Merge pull request #5584 from AJ0070/5583-export-cleanup
fix: remove an export's working directory once its archive is built and the archive once it is downloaded
2026-11-11 18:06:08 -05:00
Isaac Connor 02d2749fe8 Merge pull request #5590 from AJ0070/5589-console-dead-filters
perf: drop the per-monitor event filters the console page builds and never uses
2026-11-11 18:02:16 -05:00
Jash c9de8488d5 fix: look up an event's highest scoring frame by FrameId in the API events index fixes #5591 2026-11-12 03:57:43 +05:30
Jash 2682e995a6 perf: drop the per-monitor event filters the console page builds and never uses fixes #5589 2026-11-12 03:52:00 +05:30
Jash c4c5e2b15c fix: remove an export's working directory once its archive is built and the archive once it is downloaded fixes #5583 2026-11-12 03:36:15 +05:30
Jash dcb404e5d7 fix: use the Group model when an API group edit fails validation fixes #5579 2026-11-12 03:00:29 +05:30
Jash 90993466a4 fix: quote storage paths passed to df, du, ffprobe and AutoExecute refs #5556 2026-11-12 01:07:48 +05:30
Jash bb36f9b5ac perf: read the Janus pin from shared memory instead of running zmu fixes #5552 2026-11-12 00:27:25 +05:30
Jash fd449b822d perf: read the monitor state from shared memory in the status poll instead of running zmu fixes #5543 2026-11-11 23:01:58 +05:30
Jash 3f1907960a perf: ask zmdc.pl whether ZoneMinder is running once a request fixes #5537 2026-11-11 19:49:28 +05:30
Isaac Connor c297266071 Merge pull request #5481 from AJ0070/3993-montage-layout-name
fix: overwrite your own montage layout when saving under its name
2026-11-11 09:01:04 -05:00
Jash f40d34ed5a Merge remote-tracking branch 'upstream/master' into 5083-auth-failure-tables 2026-11-11 09:32:44 +05:30
Jash 789d3c2254 fix: reject built-in preset names and match layout names literally when saving refs #3993 2026-11-11 09:31:05 +05:30
Isaac Connor 51fdbd7d20 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-11-10 22:37:41 -05:00
Isaac Connor 9b46479dd4 Merge pull request #5479 from AJ0070/5190-filter-save-overwrite
fix: keep the filter id in the url restored by back so save overwrites
2026-11-10 22:35:53 -05:00
Isaac Connor d32b3d4752 Merge pull request #5069 from AJ0070/fix/4727-clear-logs
fix: clear all logs when no rows are selected
2026-11-10 19:14:43 -05:00
Isaac ConnorandClaude Opus 4.8 04f097b9c0 fix: surface export copy failures and stop output accumulating fixes #5085
exportEvents() copies each event file with exec($cmd, $output, $return)
and only put $return into a ZM\Debug line, so a failed cp never reached
the user and the export still handed back an archive missing files - the
"fails silently" half of #5074. $output was also never reset between
iterations, and exec() appends to a non-empty array, so that Debug line
accumulated every line of output from every file in the export.

Reset $output before each copy, and on a non-zero return log a ZM\Error
and mark the export failed; after the loop, return false when any copy
failed so ajax/event.php reports "Export Failed" instead of serving an
incomplete archive, matching how the tar/zip step already handles its
own exec() status.

tests/php/test_export_copy_failure.php extracts the exportEvents() body
from the real source and checks the reset and the failure handling are
present; it fails against the pre-fix source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-08 18:07:30 -05:00
Jash 62e8d24e29 fix: port clear all logs to the log panel and report server refusals, refs #4727 2026-11-08 15:01:42 +05:30
Jash 0f5c823378 Merge remote-tracking branch 'upstream/master' into fix/4727-clear-logs
# Conflicts:
#	web/skins/classic/views/js/log.js
#	web/skins/classic/views/js/log.js.php
#	web/skins/classic/views/log.php
2026-11-08 14:54:24 +05:30
Jash a2941aa759 fix: overwrite your own montage layout when saving under its name instead of duplicating it, refs #3993 2026-11-08 14:45:43 +05:30
Jash c00306433f fix: keep the filter id in the url restored by back so save overwrites, fixes #5190 2026-11-08 14:20:33 +05:30
Jash 6a696a0ce8 fix: send expired sessions to login from the events and log tables, fixes #5083 2026-11-08 14:14:05 +05:30
Isaac ConnorandClaude Opus 4.8 be82debafa chore: remove the dead classic plugin view fixes #5101
web/skins/classic/views/plugin.php queried a PluginsConfig table that no
schema or migration creates and read ZM_PLUGINS_CONFIG_PATH, which is not a
ConfigData option, so ?view=plugin could never run. Nothing links to the
view, no menu or router entry references it, and its history shows only
sweeping maintenance edits, never plugin-feature work. It is a vestige of
the old 1.2x plugin experiment.

Remove the view and its per-view skin assets (js/plugin.js and the base,
classic and dark plugin.css). PluginsConfig and ZM_PLUGINS_CONFIG_PATH
appear nowhere else in the tree.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-07 23:42:11 -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 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 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 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 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