CVE-2022-40314 Moodle remote code execution
Critical 9.8
Published
Updated
Check this codebase for CVE-2022-40314 and fix it if it is affected.
What it is: CVE-2022-40314 is a critical vulnerability in Moodle Moodle, published on 30 Sep 2022.
Exploitation: There is no known exploitation of CVE-2022-40314 in the wild and no public exploit code.
Affected packages and fixed versions:
- moodle/moodle (Packagist): affected all versions; fixed in 3.9.17
- moodle/moodle (Packagist): affected all versions; fixed in 3.9.17
- moodle/moodle (Packagist): affected from 3.11; fixed in 3.11.10
- moodle/moodle (Packagist): affected from 3.11; fixed in 3.11.10
- moodle/moodle (Packagist): affected from 4.0; fixed in 4.0.4
- moodle/moodle (Packagist): affected from 4.0; fixed in 4.0.4
- moodle (Bitnami): affected from 3.9.0; fixed in 3.9.17, 3.11.10, 4.0.4
Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.
Reference: https://insights.sbomify.com/CVE-2022-40314/ (Markdown: https://insights.sbomify.com/CVE-2022-40314/index.md)
- Exploited in the wild
- Not known
- Fix
- Available
What is CVE-2022-40314?
CVE-2022-40314 is a critical vulnerability in Moodle Moodle, published on 30 Sep 2022.
Official description
A remote code execution risk when restoring backup files originating from Moodle 1.9 was identified.
Weakness: CWE-502
Which versions are affected by CVE-2022-40314?
7 open source packages ship an affected version, including moodle/moodle and moodle. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
moodle/moodle Packagist | All versions | 3.9.17 |
moodle/moodle Packagist | All versions | 3.9.17 |
moodle/moodle Packagist | From 3.11 | 3.11.10 |
moodle/moodle Packagist | From 3.11 | 3.11.10 |
moodle/moodle Packagist | From 4.0 | 4.0.4 |
moodle/moodle Packagist | From 4.0 | 4.0.4 |
1 more packages
moodle Bitnami | From 3.9.0 | 3.9.17, 3.11.10, 4.0.4 |
Products include Moodle Moodle.
How do I fix CVE-2022-40314?
Upgrade moodle/moodle to a fixed version for your release line: 3.9.17, 3.11.10 or 4.0.4.
Is CVE-2022-40314 being exploited?
There is no known exploitation of CVE-2022-40314 in the wild and no public exploit code.
Other vulnerabilities in Moodle Moodle
- CVE-2006-4935 File upload in n/a
- CVE-2006-4936 Moodle does not properly validate module instance id
- CVE-2004-2233 Unknown "front page vulnerability with Moodle servers" for Moodle before 1.3.2 has unknown impact and attack vectors.
- CVE-2004-2235 Cross-site scripting in n/a
- CVE-2004-2236 Other in n/a
Sources
Also known as BIT-moodle-2022-40314, GHSA-2hmm-q272-xmhf, UBUNTU-CVE-2022-40314.