CVE-2022-40313 Moodle Stored Cross-site Scripting and page denial of service

High 7.1 Published Updated

Attackers can inject malicious scripts via Mustache templates, leading to XSS or denial of service in Moodle.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-40313?

CVE-2022-40313 is a high-severity cross-site scripting vulnerability in Fedoraproject Extra Packages for Enterprise Linux, published on 30 Sep 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Recursive rendering of Mustache template helpers containing user input could, in some cases, result in an XSS risk or a page failing to load.

Weakness: CWE-79

Which versions are affected by CVE-2022-40313?

7 open source packages ship an affected version, including moodle/moodle and moodle. It affects 3 products.

PackageAffectedFixed in
moodle/moodle PackagistFrom 3.113.11.10
moodle/moodle PackagistFrom 3.113.11.10
moodle/moodle PackagistFrom 3.93.9.17
moodle/moodle PackagistFrom 3.93.9.17
moodle/moodle PackagistFrom 4.04.0.4
moodle/moodle PackagistFrom 4.04.0.4
1 more packages
moodle BitnamiFrom 3.9.03.9.17, 3.11.10, 4.0.4

Products include Fedoraproject Extra Packages for Enterprise Linux, Fedoraproject Fedora, Moodle Moodle.

How do I fix CVE-2022-40313?

Upgrade moodle/moodle to a fixed version for your release line: 3.11.10, 3.9.17 or 4.0.4.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2022-40313 being exploited?

There is no known exploitation of CVE-2022-40313 in the wild and no public exploit code.

All Fedoraproject Extra Packages for Enterprise Linux vulnerabilities

Sources

Also known as BIT-moodle-2022-40313, GHSA-jqgr-gh62-jf53, UBUNTU-CVE-2022-40313.

Is CVE-2022-40313 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free