Files
cacti/tests/Unit/Security/Shell/SnmpControlCharacterValidationTest.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

23 lines
852 B
PHP

<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
+-------------------------------------------------------------------------+
*/
/*
* GHSA-m3fh-gxqj-76hq: the SNMPv3 credential device fields (sibling of the
* snmp_community newline defect) must strip control characters before the
* values reach the net-snmp command line.
*/
$root = dirname(__DIR__, 4);
test('SNMPv3 credential fields strip control characters (GHSA-m3fh)', function () use ($root) {
$s = file_get_contents($root . '/lib/api_device.php');
expect($s)->toContain('(string) form_input_validate($snmp_password')
->and($s)->toContain('(string) form_input_validate($snmp_priv_passphrase')
->and($s)->toContain('(string) form_input_validate($snmp_community');
});