CVE-2024-38276: Moodle/moodle Moodle CSRF Risks Due To Vulnerability

MODERATE
Advisory Identifier: GHSA-356g-7x36-7m34
CVSS 5.4
CWE-352
Published
Advisory Summary

CVE-2024-38276 is a MODERATE (CVSS 5.4) moodle csrf risks due to vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Moodle/moodle libraries in the Packagist ecosystem. The issue involves moodle csrf risks due to misuse of confirm_sesskey. Remediation is available by upgrading affected packages to version 4.4.1, 4.3.5, 4.2.8, 4.1.11.

CVE-2024-38276 at a Glance

CVE Identifier CVE-2024-38276
GHSA Identifier GHSA-356g-7x36-7m34
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Moodle/moodle
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-38276

To remediate this vulnerability, upgrade all affected Moodle/moodle dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

moodle/moodle fixed: 4.4.1
Upgrade moodle/moodle to 4.4.1
moodle/moodle fixed: 4.3.5
Upgrade moodle/moodle to 4.3.5
moodle/moodle fixed: 4.2.8
Upgrade moodle/moodle to 4.2.8
moodle/moodle fixed: 4.1.11
Upgrade moodle/moodle to 4.1.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for moodle/moodle

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-38276, inspect your project dependencies for Moodle/moodle:

inspect dependencies for moodle/moodle

Analyze the terminal output to locate any version of Moodle/moodle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Moodle/moodle, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Incorrect CSRF token checks resulted in multiple CSRF risks.

CVE-2024-38276 Affected Moodle/moodle Versions

4 component(s)
Fixed Versions:
4.4.14.3.54.2.84.1.11
Product / Package Ecosystem Affected Versions Fixed Version
moodle/moodle
Packagist
≥ 4.4.0-beta
< 4.4.1
4.4.1
moodle/moodle
Packagist
≥ 4.3.0-beta
< 4.3.5
4.3.5
moodle/moodle
Packagist
≥ 4.2.0-beta
< 4.2.8
4.2.8
moodle/moodle
Packagist
< 4.1.11
4.1.11

References

NVD — CVE-2024-38276 NVD
https://nvd.nist.gov/vuln/detail/CVE-2024-38276
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/f2807dee5bc777d9c58b7a70cba6e4c21ee02ea1
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/e23f603c41055ab92f9b430cf0e7a54b4e120f95
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/e1dab5f38166a2ff62983178f7bf8f0ed3a61090
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/dc84fcfab06a4a0fe37797b8422e9fe3a1031c3e
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/da8e8cee6ffaf7c184eded97e1016f20c9de0561
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/c5b1604e8136db6d72057dd8052955058489206c
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/c1aacb3e2884ea4dcc221c5ef2e449ce345f78ae
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/c18b59808cefe7b54c85dce6bf2cc71601080667
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/a0d8c025f732d5c18a2b9d1a8e5cbee35dce86f4
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/9af9711c0a78ebad87d49bcb369ff813bc57d0a7
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/756090ed79aa056d0b5f58e7a1dff67f139f76b4
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/57f20b6cb352893871c3afdfa8a4c09a96e16764
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/31ced0851189a6879e4cd27c7e65d21dd9d6e87e
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/30fadc3686fa7490860a0bd87a29636139dfb371
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/137d311fd1354c679b974633512a771e6e0559a1
Security Fix Commit FIX COMMIT
https://github.com/moodle/moodle/commit/093aedf79889114d004495f05969168b646b0285
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/F7AZYR7EXV6E5SQE2GYTNQE3NOENJCQ6
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GHTIX55J4Q4LEOMLNEA4OZSWVEENQX7E
moodle.org/mod/forum/discuss.p... WEB
https://moodle.org/mod/forum/discuss.php?d=459501
Moodle/moodle Source Repository REPOSITORY
https://github.com/moodle/moodle

Frequently Asked Questions

What is CVE-2024-38276?
CVE-2024-38276 is a security vulnerability in Moodle/moodle involving Moodle CSRF risks due to misuse of confirm_sesskey under CWE-352: Cross-Site Request Forgery (CSRF).
Which Moodle/moodle versions are affected?
Affected versions include releases prior to 4.4.1, 4.3.5, 4.2.8, 4.1.11 across affected packages: moodle/moodle.
What version fixes CVE-2024-38276?
Upgrading to 4.4.1, 4.3.5, 4.2.8, 4.1.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is moodle/moodle affected?
Yes, moodle/moodle is affected in releases prior to 4.4.1, 4.3.5, 4.2.8, 4.1.11. Upgrade your dependency to 4.4.1, 4.3.5, 4.2.8, 4.1.11 or later.
What is the CVSS score of CVE-2024-38276?
CVE-2024-38276 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2024-38276?
CVE-2024-38276 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check Packagist dependencies for CVE-2024-38276?
Run the dependency tree command: 'inspect dependencies for moodle/moodle'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-356g-7x36-7m34",
  "modified" : "2024-06-27T03:30:55Z",
  "published" : "2024-06-18T21:30:36Z",
  "aliases" : [ "CVE-2024-38276" ],
  "summary" : "Moodle CSRF risks due to misuse of confirm_sesskey",
  "details" : "Incorrect CSRF token checks resulted in multiple CSRF risks.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "moodle/moodle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.4.0-beta"
      }, {
        "fixed" : "4.4.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "moodle/moodle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.3.0-beta"
      }, {
        "fixed" : "4.3.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "moodle/moodle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0-beta"
      }, {
        "fixed" : "4.2.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "moodle/moodle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38276"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/f2807dee5bc777d9c58b7a70cba6e4c21ee02ea1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/e23f603c41055ab92f9b430cf0e7a54b4e120f95"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/e1dab5f38166a2ff62983178f7bf8f0ed3a61090"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/dc84fcfab06a4a0fe37797b8422e9fe3a1031c3e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/da8e8cee6ffaf7c184eded97e1016f20c9de0561"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/c5b1604e8136db6d72057dd8052955058489206c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/c1aacb3e2884ea4dcc221c5ef2e449ce345f78ae"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/c18b59808cefe7b54c85dce6bf2cc71601080667"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/a0d8c025f732d5c18a2b9d1a8e5cbee35dce86f4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/9af9711c0a78ebad87d49bcb369ff813bc57d0a7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/756090ed79aa056d0b5f58e7a1dff67f139f76b4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/57f20b6cb352893871c3afdfa8a4c09a96e16764"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/31ced0851189a6879e4cd27c7e65d21dd9d6e87e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/30fadc3686fa7490860a0bd87a29636139dfb371"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/137d311fd1354c679b974633512a771e6e0559a1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moodle/moodle/commit/093aedf79889114d004495f05969168b646b0285"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/F7AZYR7EXV6E5SQE2GYTNQE3NOENJCQ6"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GHTIX55J4Q4LEOMLNEA4OZSWVEENQX7E"
  }, {
    "type" : "WEB",
    "url" : "https://moodle.org/mod/forum/discuss.php?d=459501"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/moodle/moodle"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-18T22:45:39Z",
    "nvd_published_at" : "2024-06-18T20:15:14Z"
  }
}