Commit Graph
92 Commits
Author SHA1 Message Date
Jash 94b82f2a21 fix: keep the per-event export dir to the owner and off the flat path refs #5074 2026-09-01 07:50:15 +05:30
Jash e741d9b5bd fix: set an explicit mode on the per-event export dir fixes #5074 2026-08-30 01:35:53 +05:30
copilot-swe-agent[bot]andconnortechnology 114f41aa6b fix: add -- to cp -as commands to prevent path/flag confusion
Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
2026-03-09 16:55:01 +00:00
Isaac ConnorandClaude Opus 4.6 b3a7c05f07 fix: close SQL injection, command injection, and shell escaping gaps
FilterTerm.php:
- Use intval() on AlarmedZoneId value in SQL subquery to prevent
  injection via crafted filter val

report_event_audit.php, montagereview.php:
- Cast $selected_monitor_ids through array_map('intval') before
  interpolating into SQL IN clause (values come from $_REQUEST)

download_functions.php:
- Replace manual single-quoting with escapeshellarg() for merged
  file name in ffmpeg, tar, and zip commands (monitor names can
  contain shell metacharacters including single quotes)
- Same fix for export list file path

export_functions.php:
- Use escapeshellarg() on source and destination paths in cp -as
  commands during event export

functions.php:
- Validate column keys in getFormChanges() against /^[a-zA-Z0-9_]+$/
  to prevent SQL injection via crafted array keys from $_REQUEST
- Use dbEscape() and intval() for image/document MIME type and size
  fields instead of raw string interpolation
- Replace escapeshellcmd() with escapeshellarg() in deletePath()
  rm -rf command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 10:48:23 -04:00
Isaac ConnorandClaude Opus 4.6 605f962b7b fix: sanitize exportFile and connkey params in event export to prevent command injection
The exportFile POST parameter was passed unsanitized to exportEvents() as
$export_root, which was then interpolated directly into shell commands
executed via exec(). An authenticated user with View permissions for Events
could inject arbitrary shell commands through the exportFile parameter.

The connkey parameter had the same vulnerability.

Strip both values to safe characters (word chars, hyphens, dots) on entry
to exportEvents(), and wrap the directory argument to tar/zip with
escapeshellarg() as defense in depth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:46:38 -05:00
Steve Gilvarry e389eed485 Final cleanup of videojs update 2025-12-31 19:33:54 +11:00
Steve Gilvarry f095a2eb10 Remove zoom 2025-12-31 19:33:54 +11:00
Steve Gilvarry 48096ce4f0 Remove rotation once I worked out that videowriter puts it into the mp4... 2025-12-31 19:33:54 +11:00
Steve Gilvarry 819da45ecc Fix double rotation 2025-12-31 19:33:54 +11:00
Steve Gilvarry 8760a2b79f Fix rotation strings to numeric rotation values 2025-12-31 19:33:53 +11:00
Steve Gilvarry 4463f5dcf7 Videojs not loaded when inline script called. 2025-12-31 19:33:53 +11:00
Steve Gilvarry 277cf15518 Fix Nonce and attempt text tracks fixes 2025-12-31 19:33:53 +11:00
Steve Gilvarry a71d5d9c3c Update Videojs to v8 2025-12-31 19:33:53 +11:00
Isaac Connor dd064f606a Fix two straggling array uses of user 2023-04-24 10:16:46 -04:00
Isaac Connor 8a6db4a5e7 convert event->Id() explicitly to a string for strpos. 2022-09-22 16:21:25 -04:00
Isaac Connor bd22cd7fdd Use global dateTimeFormatter to replace strftime 2022-06-01 16:17:00 -04:00
Isaac Connor 72be70f166 When using flat mode, only rename files that don't aleady include the event id. Turn off master.html if only video is being downloaded 2022-05-24 12:11:55 -04:00
Ben Dailey e4f5f59e8d 3 more img tags 2022-02-22 08:31:41 -05:00
Isaac Connor 4945a016cf Restore inclusion of video files in export when not including images. Fixes #3324 2021-11-17 11:04:28 -05:00
Isaac Connor 5f381a244f Improvements to export. Fix tar -v, should be tar --version. make table width:100% and iframe height 100%. Always show thumbnail of video. Show Id of event if no other links. generate Images frame content event if no jpegs but there is an mp4. Set timeout to infinity for generating export. Provide more feedback if it breaks. Fix ticker. 2021-10-14 17:56:02 -04:00
Isaac Connor e18f8019b0 canView takes a user object, not a string 2021-09-08 19:07:51 -04:00
Isaac Connor 7127a944a1 Use event->canView so that events in snapshots can be exported 2021-08-18 10:53:59 -04:00
Isaac Connor eecf568041 Pass exportStructure around so that it can be used to put the right filename to the jpg in the html. Fix flat zips. Fix video files being included if exportMisc is true. 2021-08-06 13:18:06 -04:00
Isaac Connor bed41ca44b Support specifying the export filename by passing the export_root 2021-08-05 13:30:52 -04:00
Isaac Connor f6fcc2144f jquery.js doesn't exist, so link jquery.min.js instead 2021-05-22 13:59:32 -04:00
Isaac Connor 1c10cc492b Fix StartTime to StartDateTime 2020-12-02 13:15:32 -05:00
Andrew Bauer aac47ed361 fixes to export functions 2020-12-02 12:02:24 -06:00
Isaac Connor 10c0a6617c Return Debug to a regular function to match other logging functions. Since we switched to using namespaces we no longer clash with cake_php. 2020-10-14 10:39:25 -04:00
Isaac Connor 2021f561fa Import as a global 2020-08-16 20:08:26 -04:00
Isaac Connor 2441ae2924 Improve event export a little bit. Add links to eventFrames and eventDetail html. 2020-04-03 15:34:20 -04:00
Isaac Connor ef9fbac90c Add Noscript warnings. Whitespace, improve some logic 2020-04-02 18:14:14 -04:00
Alex Porosanu 28a4bef6ba fix tar invocation for *BSD platforms
"--xform" switch is not supported by tar on BSD platforms i.e. *BSD,
MacOS, etc. As such, use "-s" switch on these platforms, with a
similar regexp.
2020-01-09 22:03:02 +02:00
Isaac Connor 2c76c12664 Fix export to include files when using DEEP scheme. Also make it more efficient 2019-12-30 22:18:55 -05:00
Isaac Connor 845f35fe00 Fix cases of check before creating dirs. Add chmod so they are only readable by web user. Fix MonitorName => Monitor->Name() 2019-12-26 15:57:25 -05:00
Isaac Connor 09b42f8b55 remove nonce from js because it is the exported html not part of the zm web ui 2019-03-20 14:27:10 -04:00
Isaac Connor 7260f823cb Merge branch 'master' into storageareas 2019-01-21 13:52:38 -05:00
Matt N a1a42345e3 More eslint fixes; eslint in php; add eslint to travis (#2419)
* Add eslint to travis.yml

* Update eslint package versions and apply new indent rules

* Enable the brace-style and block-style eslint rules

* Enable the 'curly' eslint rule

* Enable the 'keyword-spacing' eslint rule

* Enable the 'key-spacing' eslint rule

* Enable the 'object-curly-spacing' eslint rule

* Enable the 'no-new-object' eslint rule

* Only disable the no-caller eslint rule in the one affected file

* Enable the 'no-unused-vars' eslint rule for local variables

* Add linting of JS in .php files
2019-01-19 10:32:40 -05:00
Isaac Connor 552e14a971 Merge branch 'master' into storageareas 2019-01-18 10:36:59 -05:00
Matt N eef113b6a7 Convert some characters to HTML entities (#2417) 2019-01-18 10:02:48 -05:00
Matt N 6bb5aa1b87 More inline JS / nonce conversions (#2415)
* monitor.php: Add nonce and move <script> inside </body>

* export_functions.php: Untested: Add @nonce to <script>

* blank.php: Add @nonce to <script> and add to CSP enforced views

* Enforce CSP on login and privacy views

* group.php: Add nonce and move <script> inside </body>

* filter.php: Add @nonce to <script>

* Fix updateButtons argument on the filter page upon change and page load

* events.php: Add @nonce to <script>
2019-01-18 09:51:06 -05:00
Isaac Connor f49dd93b6a Merge branch 'master' into storageareas 2019-01-16 14:39:56 -05:00
Matt N d33fec9c3f Add a CSP script-src policy with nonce-source and convert more inline event handlers (#2413)
* Add Content-Security-Policy-Report-Only: script-src 'self' 'nonce-' policy

* Use @data-on-click-this to attach inline click event handlers which expect being called with 'this'

Only handle ones that don't return a value.

* Use @data-on-click to attach inline click event handlers with no args and no return value

* Use @data-on-click-true to attach inline click event handlers with 'true' as the only argument

* Enforce a script-src CSP on views without inline JS

* Convert some onchange attributes to data-on-change
2019-01-16 09:59:58 -05:00
Isaac Connor 700b3c33a0 fix command line when using .zip 2018-09-25 16:09:50 -04:00
Isaac Connor 53f4276cb7 add thumbnails and an mp4 download in the events list 2018-09-25 16:00:01 -04:00
Isaac Connor 40292f3dad Add Compression flag 2018-09-07 09:08:33 -04:00
Isaac Connor 965ffda01e Add button types. fix extra px in slideheight 2018-07-17 15:32:30 -04:00
Isaac Connor 43cee7c383 make export work and fix links to jquery.js 2018-07-12 14:07:03 -04:00
Isaac Connor e85c16aba6 Cleanups, add video viewing 2018-07-09 11:58:30 -04:00
Isaac Connor 54e7b0ac16 create ZM_EXPORT_DIR if needed (#2136) 2018-06-25 13:57:00 -04:00
Isaac cfbbc238c9 remove extra spaces and parenthesis 2018-05-18 15:51:12 +02:00