Moodle XML Import of ddwtos Remote Code Execution

moodle/moodle Updated 02 Oct 2025

Summary

13/05/2022
Yes i
High
8.8

CVE-2018-14630: Moodle XML import of ddwtos could lead to intentional remote code execution. Affects moodle/moodle across 4 version ranges.

< 3.1.14 >= 3.2.0, < 3.3.8 >= 3.4.0, < 3.4.5 >= 3.5.0, < 3.5.2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Moodle is an open-source learning management system used by educational institutions worldwide. It provides a platform for creating and managing online courses, quizzes, and assessments. The Moodle package, specifically versions 3.5.0 to 3.5.1, 3.4.0 to 3.4.4, 3.2.0 to 3.3.7, and 3.1.0 to 3.1.13, is susceptible to a remote code execution vulnerability when importing XML files containing 'drag and drop into text' (ddwtos) type quiz questions. This vulnerability allows an attacker to inject and execute PHP code within the imported questions, potentially leading to unauthorized access and control of the Moodle instance.

Vulnerability Detail

The vulnerability arises from a lack of proper input validation and sanitization during the XML import process. By crafting malicious XML files with embedded PHP code, an attacker can exploit this vulnerability to execute arbitrary commands on the server hosting the Moodle instance. This can result in various consequences, including unauthorized data access, privilege escalation, and potential compromise of the entire Moodle system. The severity of this vulnerability is rated as HIGH with a CVSS score of 8.8.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 3.1.14 3.1.14
    composer require moodle/moodle:3.1.14
  • >= 3.2.0, < 3.3.8 3.3.8
    composer require moodle/moodle:3.3.8
  • >= 3.4.0, < 3.4.5 3.4.5
    composer require moodle/moodle:3.4.5
  • >= 3.5.0, < 3.5.2 3.5.2
    composer require moodle/moodle:3.5.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, users can disable the XML import functionality in Moodle to prevent potential exploitation. This can be achieved by modifying the Moodle configuration to restrict access to the XML import feature or by removing the XML import plugin altogether. However, this workaround may limit the functionality of Moodle and should only be considered until the system can be upgraded to a patched version.

Conclusion

The Moodle XML import vulnerability poses a significant risk to Moodle instances running affected versions. It allows attackers to execute arbitrary PHP code, potentially compromising the entire system. To mitigate this risk, it is crucial to upgrade to the latest patched version of Moodle. For further assistance and support in addressing this vulnerability, please contact DevNack.com.

See every vulnerability recorded for moodle/moodle →

Share this vulnerability

FAQ

Moodle is an open-source learning management system used by educational institutions to create and manage online courses.

This vulnerability allows an attacker to execute arbitrary PHP code on the server hosting the Moodle instance, potentially leading to unauthorized access and control of the system.

To fix this vulnerability, it is recommended to upgrade to the latest version of Moodle (3.5.2, 3.4.5, 3.3.8, or 3.1.14) where the issue has been addressed.

Yes, users can temporarily disable the XML import functionality in Moodle to mitigate the risk of exploitation. However, this may limit the system's functionality and should only be considered until the upgrade can be performed.

The severity of this vulnerability is rated as HIGH with a CVSS score of 8.8.

Related vulnerabilities

Recent vulnerabilities recorded for moodle/moodle.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 3.1.14 3.1.14
    composer require moodle/moodle:3.1.14
  • >= 3.2.0, < 3.3.8 3.3.8
    composer require moodle/moodle:3.3.8
  • >= 3.4.0, < 3.4.5 3.4.5
    composer require moodle/moodle:3.4.5
  • >= 3.5.0, < 3.5.2 3.5.2
    composer require moodle/moodle:3.5.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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