Cross-site Scripting (XSS) - Stored in elgg/elgg
Description
elgg is vulnerable to Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
elgg/elggPackagist | < 3.3.24 | 3.3.24 |
Affected products
2Patches
Vulnerability mechanics
Root cause
"Missing input sanitization on the reported content address field allows stored cross-site scripting."
Attack vector
An attacker can submit a report via the reported content action with a crafted `address` parameter containing JavaScript, e.g. `javascript:alert(1)`. Because the address is stored unsanitized and later rendered in a web page served to other users (such as administrators reviewing reports), the malicious payload executes in the context of the victim's session [CWE-79]. The attack requires no special privileges beyond the ability to submit a reported content report.
Affected code
The vulnerable code is in `mod/reportedcontent/actions/reportedcontent/add.php` [patch_id=1699464]. The action directly assigns the user-supplied `$address` parameter to `$report->address` without sanitization, allowing arbitrary URLs to be stored.
What the fix does
The patch replaces the direct assignment `$report->address = $address` with `$report->address = elgg_normalize_site_url($address)` [patch_id=1699464]. The `elgg_normalize_site_url()` function validates that the provided URL is a legitimate site URL, rejecting dangerous schemes like `javascript:` or `data:`. This closes the XSS vector by ensuring only safe, normalized URLs are stored and later displayed.
Preconditions
- authAttacker must be able to submit a reported content report (any authenticated user can typically do this)
- inputThe address parameter must contain a malicious payload such as javascript: or data: URI
Generated on May 23, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/advisories/GHSA-2xw8-j43j-5vxpghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2021-4072ghsaADVISORY
- github.com/elgg/elgg/commit/c30b17bf75256ed3fcc84e2083147cc3951423d0ghsax_refsource_MISCWEB
- huntr.dev/bounties/74034253-732a-4251-a0f9-eca5f576c955ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.