VYPR
Unrated severityOSV Advisory· Published Jan 16, 2019· Updated Aug 5, 2024

CVE-2018-20724

CVE-2018-20724

Description

A cross-site scripting (XSS) vulnerability exists in pollers.php in Cacti before 1.2.0 due to lack of escaping of unintended characters in the Website Hostname for Data Collectors.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

9

Patches

Vulnerability mechanics

Root cause

"Missing HTML escaping of the hostname value before rendering in the Data Collectors table allows stored cross-site scripting."

Attack vector

An attacker with access to edit a Data Collector's settings can inject arbitrary HTML/JavaScript into the "Website Hostname" field. The payload is stored in the database and, when any user visits `pollers.php`, the unescaped hostname value is rendered in the Data Collectors table, causing the script to execute in the victim's browser [ref_id=1]. The researcher demonstrated this with the payload `<img src=xss onerror=alert(1)>` [ref_id=1].

Affected code

The vulnerable code is in `pollers.php` in the `form_selectable_cell` call that outputs the hostname value. The patch shows the fix at line 852, where `$poller['hostname']` was passed directly without escaping [ref_id=2].

What the fix does

The patch wraps `$poller['hostname']` with `html_escape()` before passing it to `form_selectable_cell` [ref_id=2]. This ensures that any HTML special characters (such as `<`, `>`, and `"`) in the hostname value are encoded as safe HTML entities, preventing the browser from interpreting attacker-supplied markup as executable code.

Preconditions

  • authAttacker must have access to edit a Data Collector's settings (e.g., via pollers.php?action=edit&id=N)
  • inputA victim user must visit pollers.php to view the Data Collectors table

Reproduction

1. Navigate to `http://localhost/cacti/pollers.php?action=edit&id=1` and set the Hostname field value to `<img src=xss onerror=alert(1)>`. 2. Visit `http://localhost/cacti/pollers.php` — the payload executes in the browser [ref_id=1].

Generated on May 26, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.