MoodleCMS

CVE-2022-45149

MEDIUM · 5.4 CVSS v3.1 Published 2022-11-23
Fix available
A fix is available. Upgrade to 3.9.18 / 3.11.11 or later.
See remediation →
61/100
Remediation priority · Elevated
Remotely reachable 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 vulnerability was found in Moodle which exists due to insufficient validation of the HTTP request origin in course redirect URL. A user's CSRF token was unnecessarily included in the URL when being redirected to a course they have just restored. A remote attacker can trick the victim to visit a specially crafted web page and perform arbitrary actions on behalf of the victim on the vulnerable website. This flaw allows an attacker to perform cross-site request forgery attacks.

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

Moodle contains a CSRF vulnerability where the anti-CSRF token is unnecessarily exposed in the URL during course restoration redirects. Since tokens in URL parameters can be leaked via browser history, logs, and referrer headers, an attacker can craft a malicious page that tricks an authenticated user into performing unintended actions on the vulnerable site.

MitigationApply the vendor patch for Moodle to ensure CSRF tokens are not exposed in redirect URLs and that proper HTTP Origin header validation is enforced.

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:>= 3.9.0, < 3.9.18>= 3.11.0, < 3.11.11>= 4.0.0, < 4.0.5
FedoraOperating system
Affected:= 35= 36= 37

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

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/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 checks

Work through these to decide whether this CVE applies to you.

  1. Determine installed Moodle version
    Check the version.php file in your Moodle installation root directory, or navigate to Site Administration > Server > Environment to view the installed Moodle version.
    Affected if The installed version falls within: 3.9.0 to 3.9.17, 3.11.0 to 3.11.10, or 4.0.0 to 4.0.4.
  2. Verify course restoration feature is accessible
    Confirm that the course restoration functionality is enabled in your Moodle instance. Check under Site Administration > Courses > Course defaults or by attempting to access the restore function as an administrator.
    Affected if Course restoration is enabled and accessible to authenticated users.
  3. Check for CSRF token exposure in redirect URLs
    Perform a course restoration operation while monitoring browser developer tools Network tab or HTTP proxy. Observe whether the anti-CSRF token (sesskey) appears in redirect URL parameters rather than in POST data or HTTP headers.
    Affected if The sesskey or token parameter is visible in the URL string during or after the course restoration redirect sequence.
  4. Review HTTP server access logs for token leakage
    Examine web server access logs (Apache, Nginx) for requests containing 'sesskey=' or 'token=' in URL query parameters, particularly those referencing course restore functionality.
    Affected if URL query parameters containing CSRF tokens are logged by the web server.

Your environment is affected if the installed Moodle version matches the vulnerable ranges AND the course restoration feature is accessible to users, as this is where the CSRF token gets exposed in redirect URLs.

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 3.9.18 / 3.11.11 / 4.0.5 or later
Fixed in 3.9.183.11.114.0.5
Interim mitigation

Apply the vendor patch for Moodle to ensure CSRF tokens are not exposed in redirect URLs and that proper HTTP Origin header validation is enforced.

Recommended fix High confidence

Moodle 3.9.18, 3.11.11, or 4.0.5 (or later respective releases)

  1. 1. Back up your current Moodle database and codebase before proceeding with the upgrade
  2. 2. Download the appropriate fixed version of Moodle for your current branch: 3.9.18, 3.11.11, or 4.0.5 (or later)
  3. 3. Place your server in maintenance mode via Site Administration > Server > Maintenance Mode
  4. 4. Replace your Moodle code directory with the new version files, preserving your config.php and any custom plugins
  5. 5. Run the upgrade process by accessing the Moodle site in your browser
  6. 6. Complete any database upgrades when prompted
  7. 7. Exit maintenance mode once upgrades are complete
  8. 8. Verify the course redirect functionality works correctly
Caveat Minor version upgrades typically have minimal breaking changes; ensure config.php compatibility and backup before upgrading

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

Fix this in Moodle Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing3.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,490
Get the upgrade done

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

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

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