CVE-2025-67850
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 · uneditedA flaw was found in moodle. This vulnerability, known as Cross-Site Scripting (XSS), occurs due to insufficient checks on user-provided data in the formula editor's arithmetic expression fields. A remote attacker could inject malicious code into these fields. When other users view these expressions, the malicious code would execute in their web browsers, potentially compromising their data or leading to unauthorized actions.
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 · moderate confidenceThis is a stored Cross-Site Scripting (XSS) vulnerability in Moodle's formula editor. The application fails to properly sanitize user input in arithmetic expression fields, allowing an attacker to inject malicious JavaScript code that executes in the browsers of other users who view these expressions.
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< 4.1.22>= 4.4.0, < 4.4.11>= 4.5.0, < 4.5.8>= 5.0.0, < 5.0.4= 5.1.0CVSS 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
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
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 checksWork through these to decide whether this CVE applies to you.
-
Identify installed Moodle versionCheck the version.php file in the Moodle root directory or access the Site Administration > Server > Environment page to view the installed Moodle versionAffected if The installed version falls within 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
-
Determine if formula editor is in useCheck if any courses or activities contain questions or content using the Moodle formula editor (Question type: Calculated, Calculated multichoice, or Formula question types) by querying the mdl_question and mdl_question_answers tables in the database for records with qtype containing 'formula' or 'calculated'Affected if The formula editor feature is actively used and the Moodle version is vulnerable
-
Inspect stored formula content for XSS payloadsQuery the database for any formula question content that may contain script tags, javascript: handlers, or other XSS vectors. Check tables mdl_question, mdl_question_answers, and mdl_question_numerical for unusual HTML or script content in formula fields. Example SQL: SELECT * FROM mdl_question WHERE qtype LIKE '%formula%' OR questiontext LIKE '%<script%'Affected if Any formula content contains unsanitized JavaScript or HTML tags such as <script>, <img onerror>, or event handlers like onload/onerror
A user is affected if their Moodle installation version is within the vulnerable ranges AND they have the formula editor enabled with stored formula content that could contain malicious scripts.
Generated from the published advisory. Verify against your own configuration.
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 · scoped4.1.224.4.114.5.8
Implement proper input validation and output encoding for all user-provided formula content in the formula editor. Use Moodle's built-in sanitization functions (such as clean_param or s()) to neutralize malicious script content before storage and display.
Upgrade to the latest available version in your current branch: 4.1.22 (for 4.1.x), 4.4.11 (for 4.4.x), 4.5.8 (for 4.5.x), or 5.0.4 (for 5.0.x)
- 1. Back up your Moodle database and entire installation directory (including moodledata) before proceeding.
- 2. Place your site into Maintenance Mode via Site Administration > Server > Maintenance Mode.
- 3. Download the appropriate fixed version of Moodle (4.1.22, 4.4.11, 4.5.8, or 5.0.4) from https://download.moodle.org/releases/
- 4. Extract the new Moodle files and replace your existing installation, preserving config.php and any custom code in lib/local or theme directories.
- 5. Run the Moodle upgrade process by accessing the site URL - the upgrade.php script will automatically run.
- 6. Verify the upgrade completed successfully by checking Site Administration > Server > System paths and confirming the Moodle version displayed.
- 7. Test the formula editor functionality to confirm the XSS fix is working properly.
- 8. Disable Maintenance Mode once testing is complete.
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation6.0 h
- Testing4.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,224.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-67850 — 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-67850 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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