Files
cacti/tests/Unit/Security/ShellInjection/ResourceCacheOutPhpBinaryEscapeTest.php
TheWitness 7b551eea72 chore: normalize CRLF line endings to LF across Cacti-owned files (#8156)
Excludes vendored packages, third-party JS, patches, and the Win32 probe fixture. Pure EOL change; guards pass and php -l is clean.
2026-10-02 17:22:42 -04:00

21 lines
792 B
PHP

<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
+-------------------------------------------------------------------------+
*/
/*
* GHSA-4p7f-qcc2-vmx7: resource_cache_out() built a system() command by
* concatenating the admin-set path_php_binary value with no escaping. It must
* now be escaped like every other path_php_binary consumer in the codebase.
*/
$root = dirname(__DIR__, 4);
$source = file_get_contents($root . '/lib/poller.php');
test('resource_cache_out escapes path_php_binary before system()', function () use ($source) {
expect($source)->toContain('system(cacti_escapeshellcmd($php_path)')
->and($source)->not->toContain('system($php_path');
});