MoodleCMS

CVE-2022-45150

MEDIUM · 6.1 CVSS v3.1 Published 2022-11-23
Fix available
A fix is available. Upgrade to 3.9.18 / 3.11.11 or later.
See remediation →
68/100
Remediation priority · Elevated
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
A reflected cross-site scripting vulnerability was discovered in Moodle. This flaw exists due to insufficient sanitization of user-supplied data in policy tool. An attacker can trick the victim to open a specially crafted link that executes an arbitrary HTML and script code in user's browser in context of vulnerable website. This vulnerability may allow an attacker to perform cross-site scripting (XSS) attacks to gain access potentially sensitive information and modification of web pages.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

A reflected cross-site scripting (XSS) vulnerability exists in Moodle's policy tool due to insufficient sanitization of user-supplied data. An attacker can craft a malicious link that, when clicked by a victim, executes arbitrary HTML and script code in the victim's browser within the context of the vulnerable website.

MitigationApply the official Moodle security patch which implements proper input sanitization and output encoding in the policy tool component to neutralize the XSS vector.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
MoodleCMS
Affected:>= 3.9.0, < 3.9.18>= 3.11.0, < 3.11.11>= 4.0.0, < 4.0.5
FedoraOperating system
Affected:= 35= 36= 37

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Determine installed Moodle version
    Locate the version.php file in the Moodle lib directory or access Site Administration > Server > Environment to view the installed version number
    Affected if The installed version falls within the vulnerable ranges: >= 3.9.0 and < 3.9.18, >= 3.11.0 and < 3.11.11, or >= 4.0.0 and < 4.0.5
  2. Verify policy tool is accessible
    Navigate to Site Administration > Users > Policies and acceptances, or directly access /admin/tool/policy/ to confirm the policy tool is enabled and accessible
    Affected if The policy tool is enabled and users can access the policy acceptance page, allowing them to click on crafted links containing malicious payloads
  3. Check for unpatched policy handler files
    Examine the file /admin/tool/policy/classes/output/renderer.php or the policy acceptance page handler for lack of proper output encoding on user-controlled parameters
    Affected if The code lacks proper htmlspecialchars() or equivalent encoding on parameters passed to the policy tool URL that could be reflected back to the user

A user is affected if they are running a Moodle version within the vulnerable ranges AND the policy tool component is accessible to users, allowing reflected XSS via crafted URLs.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 3.9.18 / 3.11.11 / 4.0.5 or later
Fixed in 3.9.183.11.114.0.5
Interim mitigation

Apply the official Moodle security patch which implements proper input sanitization and output encoding in the policy tool component to neutralize the XSS vector.

Recommended fix High confidence

Moodle 3.9.18, 3.11.11, or 4.0.5 (depending on your current branch)

  1. 1. Back up your Moodle database and moodledata directory before upgrading
  2. 2. Back up your Moodle source code directory
  3. 3. Download the appropriate Moodle fixed version (3.9.18, 3.11.11, or 4.0.5) from download.moodle.org
  4. 4. Replace the Moodle source code files with the new version
  5. 5. Run the Moodle upgrade script by accessing your site via browser (e.g., https://yourmoodleurl/admin/index.php)
  6. 6. Follow the on-screen upgrade prompts to complete the upgrade
  7. 7. Clear all Moodle caches after upgrade (Site Administration > Development > Purge caches)
  8. 8. Verify the policy tool functions correctly and test that XSS payloads are no longer executable
Caveat Major version upgrades (e.g., 3.x to 4.x) may require additional testing for plugin compatibility and theme adjustments

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Moodle Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing2.0 h
  • Review / QA2.0 h
10.0 hours of engineering $1,780
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,848.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-45150 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-45150 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data