Skip to content

hardening: escape the template filter name and skip RRD paths rrdtool would split - #879

Merged
TheWitness merged 2 commits into
developfrom
fix/output-escaping-and-rrd-paths
Nov 20, 2026
Merged

TheWitness merged 2 commits into
developfrom
fix/output-escaping-and-rrd-paths

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member
  • notify_lists.php: escape the data template name in the Template filter options.
  • includes/functions.php: new thold_rrd_path_is_safe(). thold_get_rrd_statistics() returns false, and thold_rrd_last() returns an empty timestamp (already handled as "not polled yet"), when the RRD file name holds whitespace or quote characters. A space only in a directory name behaves as before.

Tests: tests/Unit/OutputEscapingAndRrdPathTest.php (12 passing). In the full suite one test fails, TholdCommandExecutionTest (exit 127), and it fails the same way on develop. Not run against a live Cacti or rrdtool.

Fixes #878

xmacan
xmacan previously approved these changes Nov 19, 2026
Escape the data template name in the Associated Thresholds filter, and skip data sources whose RRD file name contains whitespace or quote characters instead of passing the path to rrdtool.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit 72c2be2 into develop Nov 20, 2026
7 checks passed
@TheWitness
TheWitness deleted the fix/output-escaping-and-rrd-paths branch November 20, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escape the data template filter name and skip RRD paths rrdtool would split

3 participants