CVE-2018-1133: Moodle Calculated Question Type Remote Code Execution

moodle/moodle Updated 02 Oct 2025

Summary

13/05/2022
Yes i
High
8.8

CVE-2018-1133: Moodle calculated question type allows remote code execution by Question authors. Affects moodle/moodle across 4 version ranges.

>= 3.1, < 3.1.12 >= 3.2, < 3.2.9 >= 3.3, < 3.3.6 >= 3.4, < 3.4.3

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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Moodle is an open-source learning management system widely used for online education. It provides a platform for educators to create and deliver courses, manage student enrollment, and facilitate communication and collaboration. The Calculated question type in Moodle allows teachers to create questions with dynamically calculated answers based on formulas and variables. This feature enhances the flexibility and interactivity of assessments. However, a vulnerability in Moodle's Calculated question type exposes the system to remote code execution by question authors.

Vulnerability Detail

The vulnerability, identified as CVE-2018-1133, allows a teacher with the ability to create Calculated questions to inject malicious code that will be executed on the server. By crafting a specially designed Calculated question, an attacker can exploit an eval injection vulnerability, leading to arbitrary code execution. This can have severe consequences, including unauthorized access to sensitive data, modification of course content, and potential compromise of the entire Moodle instance. The vulnerability has a CVSS score of 8.8, indicating a high severity level.

How To Fix

Fixed versions by release line

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

  • >= 3.1, < 3.1.12 3.1.12
    composer require moodle/moodle:3.1.12
  • >= 3.2, < 3.2.9 3.2.9
    composer require moodle/moodle:3.2.9
  • >= 3.3, < 3.3.6 3.3.6
    composer require moodle/moodle:3.3.6
  • >= 3.4, < 3.4.3 3.4.3
    composer require moodle/moodle:3.4.3

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, administrators can disable the Calculated question type in Moodle until the system is updated to a secure version. This can be achieved by modifying the question type settings or by restricting the permissions of teachers who have access to the Calculated question type. However, disabling the feature may impact the functionality and interactivity of existing assessments, so it should be considered a temporary measure until the upgrade can be performed.

Conclusion

The CVE-2018-1133 vulnerability in Moodle's Calculated question type exposes the system to remote code execution by question authors. It is crucial for administrators to promptly update their Moodle installations to versions 3.1.12, 3.2.9, 3.3.6, or 3.4.3, or any subsequent releases that include the fix. Disabling the Calculated question type can serve as a temporary workaround. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for moodle/moodle →

Share this vulnerability

FAQ

Moodle is an open-source learning management system used for online education. It provides a platform for educators to create and deliver courses, manage student enrollment, and facilitate communication and collaboration.

The Calculated question type in Moodle allows teachers to create questions with dynamically calculated answers based on formulas and variables. It enhances the flexibility and interactivity of assessments.

Remote code execution refers to the ability of an attacker to execute arbitrary code on a target system from a remote location. In the case of this vulnerability, a teacher with the ability to create Calculated questions can inject malicious code that will be executed on the Moodle server.

The consequences of this vulnerability can be severe. An attacker exploiting this vulnerability can gain unauthorized access to sensitive data, modify course content, and potentially compromise the entire Moodle instance.

To protect your Moodle instance, it is crucial to update to a version that includes the necessary security patches. Follow the official Moodle documentation for the upgrade process. As a temporary workaround, you can disable the Calculated question type until the upgrade is performed.

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, < 3.1.12 3.1.12
    composer require moodle/moodle:3.1.12
  • >= 3.2, < 3.2.9 3.2.9
    composer require moodle/moodle:3.2.9
  • >= 3.3, < 3.3.6 3.3.6
    composer require moodle/moodle:3.3.6
  • >= 3.4, < 3.4.3 3.4.3
    composer require moodle/moodle:3.4.3

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