CVE-2021-4072: Cross-site Scripting Vulnerability in elgg/elgg

elgg/elgg Updated 02 Oct 2025

Summary

06/01/2022
Yes i
Moderate
5.4

CVE-2021-4072: elgg is vulnerable to Cross-site Scripting. Affects elgg/elgg versions < 3.3.24. Fixed in 3.3.24. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

elgg is an open-source social networking platform that allows users to create and manage their own social networks. It provides various features such as user profiles, activity streams, and content sharing. The vulnerability in elgg (CVE-2021-4072) is related to improper neutralization of input during web page generation, leading to a cross-site scripting (XSS) vulnerability. This vulnerability allows an attacker to inject malicious scripts into web pages viewed by other users, potentially leading to unauthorized access, data theft, or other malicious activities.

Vulnerability Detail

The vulnerability in elgg arises from a failure to properly sanitize user input when generating web pages. This allows an attacker to inject arbitrary scripts or HTML code into the page, which is then executed by the victim's browser. The impact of this vulnerability can range from stealing sensitive information, such as login credentials or personal data, to performing actions on behalf of the victim, such as sending malicious requests or modifying their account settings. The vulnerability has a CVSS score of 5.4, indicating a moderate level of severity.

How To Fix

Minimum fixed version

3.3.24

This is the first release that contains the fix.

composer require elgg/elgg:3.3.24

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, a temporary workaround is to implement input validation and sanitization measures in the application code. This involves validating user input and removing or encoding any potentially malicious characters or scripts. Here is an example of how to sanitize user input in PHP:

$input = $_POST['input'];
$sanitizedInput = htmlspecialchars($input, ENT_QUOTES, 'UTF-8');
// Use the sanitized input in your application

This code snippet uses the htmlspecialchars function to encode special characters in the user input, preventing them from being interpreted as HTML or script tags.

Conclusion

The cross-site scripting vulnerability (CVE-2021-4072) in elgg can have serious consequences, including unauthorized access and data theft. It is crucial to promptly upgrade elgg to the latest version or implement input validation and sanitization measures in your application code. Regularly monitoring for vulnerabilities using tools like Vulert can also help ensure the security of your software.

See every vulnerability recorded for elgg/elgg →

Share this vulnerability

FAQ

The vulnerability allows an attacker to inject malicious scripts into web pages viewed by other users, potentially leading to unauthorized access, data theft, or other malicious activities.

To fix this vulnerability, upgrade elgg to version 3.3.24 or later. Alternatively, implement input validation and sanitization measures in your application code.

A temporary workaround is to implement input validation and sanitization measures in your application code. See the 'workaround' section for an example.

The CVSS score of this vulnerability is 5.4, indicating a moderate level of severity.

For further support on vulnerability remediation, you can contact info@devnack.com.

Related vulnerabilities

Recent vulnerabilities recorded for elgg/elgg.

How To Fix

Minimum fixed version

3.3.24

This is the first release that contains the fix.

composer require elgg/elgg:3.3.24

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback