VYPR
Moderate severityNVD Advisory· Published Dec 24, 2021· Updated Aug 3, 2024

Cross-site Scripting (XSS) - Stored in elgg/elgg

CVE-2021-4072

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.

PackageAffected versionsPatched versions
elgg/elggPackagist
< 3.3.243.3.24

Affected products

2

Patches

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

News mentions

0

No linked articles in our index yet.