MoodleCMS

CVE-2025-67851

HIGH · 7.8 CVSS v3.1 Published 2026-02-03
Fix available
A fix is available. Upgrade to 4.1.22 / 4.4.11 or later.
See remediation →
81/100
Remediation priority · High
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 flaw was found in moodle. This formula injection vulnerability occurs when data fields are exported without proper escaping. A remote attacker could exploit this by providing malicious data that, when exported and opened in a spreadsheet, allows arbitrary formulas to execute. This can lead to compromised data integrity and unintended operations within the spreadsheet.

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 · high confidence

A formula injection vulnerability exists in Moodle's data export functionality where fields are exported to CSV/spreadsheet formats without proper escaping of formula characters (such as =, +, -, @). A remote attacker can inject malicious spreadsheet formulas that execute when the exported file is opened, potentially leading to data exfiltration or arbitrary command execution via spreadsheet macros.

MitigationImplement output encoding/sanitization for all data exported from Moodle, specifically prefixing formula-initiating characters or escaping special characters to prevent spreadsheet formula interpretation.

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:< 4.1.22>= 4.4.0, < 4.4.11>= 4.5.0, < 4.5.8>= 5.0.0, < 5.0.4= 5.1.0

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
Local
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

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. Identify installed Moodle version
    Access the Moodle administration panel and navigate to Site administration > Server > Environment or check the version.php file in the Moodle root directory (look for $version or $release variables)
    Affected if The installed version falls into any of these ranges: < 4.1.22, >= 4.4.0 and < 4.4.11, >= 4.5.0 and < 4.5.8, >= 5.0.0 and < 5.0.4, or exactly 5.1.0
  2. Confirm data export functionality is in use
    Check if any of these export features are enabled: grade export (Site admin > Grades > Export), course backup exports, user data exports, or custom reports that export to CSV/spreadsheet formats
    Affected if Any data export feature that produces CSV or spreadsheet output is actively used on the Moodle site
  3. Inspect exported CSV files for formula character escaping
    Export any data from Moodle to CSV format (such as gradebook or user data export) and open the resulting file in a text editor to examine the content
    Affected if Fields containing characters =, +, -, @ at the beginning of cell values are NOT prefixed with a single quote (') or otherwise escaped, allowing potential formula injection when opened in spreadsheet software

You are affected if your Moodle version matches the vulnerable ranges AND you use any data export feature that produces CSV or spreadsheet output, with exports containing unescaped formula characters.

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 4.1.22 / 4.4.11 / 4.5.8 or later
Fixed in 4.1.224.4.114.5.8
Interim mitigation

Implement output encoding/sanitization for all data exported from Moodle, specifically prefixing formula-initiating characters or escaping special characters to prevent spreadsheet formula interpretation.

Recommended fix High confidence

Moodle 4.1.22 / 4.4.11 / 4.5.8 / 5.0.4 (depending on your current branch)

  1. 1. Identify your current Moodle version by checking the admin interface or the version.php file in the Moodle root directory.
  2. 2. Determine which branch you are running (4.1.x, 4.4.x, 4.5.x, or 5.0.x).
  3. 3. For Moodle 4.1.x: Upgrade to version 4.1.22 or later.
  4. 4. For Moodle 4.4.x: Upgrade to version 4.4.11 or later.
  5. 5. For Moodle 4.5.x: Upgrade to version 4.5.8 or later.
  6. 6. For Moodle 5.0.x: Upgrade to version 5.0.4 or later.
  7. 7. Before upgrading in production, test the upgrade in a staging environment to verify compatibility with your custom plugins and integrations.
  8. 8. After upgrading, verify that the export functionality works correctly with proper escaping of formula characters.
Caveat Major version upgrades in Moodle may include database schema changes and deprecation of legacy features; always review the release notes and test in staging first

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

Fix this in Moodle Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
18.0 hours of engineering $3,200
Get the upgrade done

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

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2025-67851 — 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-2025-67851 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