VYPR
Moderate severityNVD Advisory· Published Sep 13, 2022· Updated Aug 4, 2024

CVE-2021-36568

CVE-2021-36568

Description

In certain Moodle products after creating a course, it is possible to add in a arbitrary "Topic" a resource, in this case a "Database" with the type "Text" where its values "Field name" and "Field description" are vulnerable to Cross Site Scripting Stored(XSS). This affects Moodle 3.11 and Moodle 3.10.4 and Moodle 3.9.7.

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
moodle/moodlePackagist
<= 3.9.7
moodle/moodlePackagist
>= 3.10.0, <= 3.10.4
moodle/moodlePackagist
>= 3.11.0, < 3.11.103.11.10

Affected products

3

Patches

Vulnerability mechanics

Root cause

"Improper neutralization of user-controllable input in the "Field name" and "Field description" text fields of the Database resource type allows stored cross-site scripting."

Attack vector

An attacker who can create or edit a course adds a "Database" resource, then creates a "Text" field type within it. The attacker injects malicious JavaScript into the "Field name" or "Field description" input fields [ref_id=1]. When a victim accesses the course, clicks "Search" (the search interface for the database activity), the stored payload executes in the victim's browser [ref_id=1]. The vulnerability is classified as stored XSS [CWE-79] because the malicious script is persisted in the database and served to other users.

Affected code

The advisory does not identify specific files or functions. The vulnerability resides in the Database activity module's handling of "Text" field types, specifically the "Field name" and "Field description" input fields [ref_id=1]. These fields are rendered without proper sanitization when a user accesses the search interface.

What the fix does

No patch is included in the bundle. The advisory does not specify whether Moodle released a fix for this issue. Based on the reference write-up [ref_id=1], the remediation would require proper output encoding or sanitization of the "Field name" and "Field description" values before they are rendered in the search page, preventing injected scripts from executing.

Preconditions

  • authAttacker must have access to create or edit a course in Moodle
  • inputAttacker must be able to add a Database resource and create a Text field within it
  • inputVictim must access the course and click the 'Search' option in the database activity

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

References

10

News mentions

0

No linked articles in our index yet.