Skip to content

GHSA-qfh6-h7j6-fvjv BIT-moodle-2025-67851 CVE-2025-67851

Moodle formula injection vulnerability

High Packagist
Severity
6.1 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.29%
Chance of exploitation in the next 30 days. Higher than 21.16% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-1236 Improper Neutralization of Formula Elements in a CSV File
Fix
4.1.22
Upgrade moodle/moodle to this version or later

Description

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.

Affected versions

Packagist

PackageVulnerableFixed in
moodle/moodle
< 4.1.22
4.1.22
moodle/moodle
>= 4.4.0-beta, < 4.4.12
4.4.12
moodle/moodle
>= 4.5.0-beta, < 4.5.8
4.5.8
moodle/moodle
>= 5.0.0-beta, < 5.0.4
5.0.4
moodle/moodle
>= 5.1.0-beta, < 5.1.1
5.1.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

moodle/moodle Packagist → 4.1.22

composer
composer require moodle/moodle:^4.1.22

Severity breakdown

CVSS 3.1 6.1

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

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
Low

Weakness

CWE-1236: Improper Neutralization of Formula Elements in a CSV File

The product saves user-provided information into a Comma-Separated Value (CSV) file, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as a command when the file is opened by a spreadsheet product.

How to prevent it
  • Implementation: When generating CSV output, ensure that formula-sensitive metacharacters are effectively escaped or removed from all data before storage in the resultant CSV. Risky characters include '=' (equal), '+' (plus), '-' (minus), and '@' (at).
  • Implementation: If a field starts with a formula character, prepend it with a ' (single apostrophe), which prevents Excel from executing the formula.
  • Architecture and Design: Certain implementations of spreadsheet software might disallow formulas from executing if the file is untrusted, or if the file is not authored by the current user.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-cg8j-5cr2-568q
Moodle TeX formula editor is vulnerable to DoS through lack of execution time limits
Medium Also affects moodle/moodle
GHSA-ggxq-2mg9-8966
Moodle has a Remote Code Execution risk via file restore
High Also affects moodle/moodle
GHSA-8jrv-wx83-w3xj
Moodle Inserts Sensitive Information Into Sent Data
Medium Also affects moodle/moodle
GHSA-hcm6-q6pc-xfhm
Moodle has an authorization logic flaw
Critical Also affects moodle/moodle
GHSA-vwhw-vp9v-q9c9
Moodle vulnerable to Cross-site Scripting
Medium Also affects moodle/moodle
GHSA-5cx4-w4fh-fr57
Moodle Affected by Improper Restriction of Excessive Authentication Attempts
High Also affects moodle/moodle
GHSA-qv78-6gpp-hm68
Moodle Open Redirect vulnerability
Medium Also affects moodle/moodle
GHSA-6mmv-f6c6-v6q8
Moodle vulnerable to Cross-site Scripting
Medium Also affects moodle/moodle
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor