Summary
get_nfilter_request_var('location') returns the raw, unfiltered request value. At quicktree.php:208 and quicktree.php:336 that value is embedded directly in header('Location: ...') calls without stripping CRLF characters or URL-encoding the output. A location value containing \r\n injects arbitrary HTTP response headers. PHP 8.x throws ValueError on CRLF in header(), but PHP 7.x deployments are silently exploitable.
Details
| Field |
Value |
| File |
quicktree.php |
| Lines |
208, 336 |
| Auth required |
Yes — authenticated Cacti user |
| CWE |
CWE-93 |
// Before
header('Location: quicktree.php?location=' . get_nfilter_request_var('location'));
// After
header('Location: quicktree.php?location=' . rawurlencode(
str_replace(["\r", "\n"], '', (string) get_nfilter_request_var('location'))
));
Fix applied at both sites in branch security/quicktree-sanitize-location-header.
Acceptance criteria
Summary
get_nfilter_request_var('location')returns the raw, unfiltered request value. Atquicktree.php:208andquicktree.php:336that value is embedded directly inheader('Location: ...')calls without stripping CRLF characters or URL-encoding the output. Alocationvalue containing\r\ninjects arbitrary HTTP response headers. PHP 8.x throwsValueErroron CRLF inheader(), but PHP 7.x deployments are silently exploitable.Details
Fix applied at both sites in branch
security/quicktree-sanitize-location-header.Acceptance criteria
header()at both sitestests/Security/QuicktreeXssTest.php