Files
zoneminder/tests/php
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
..