CVE-2024-52292: Craftcms/cms Craft CMS Arbitrary System File Vulnerability
HIGHCVE-2024-52292 is a HIGH (CVSS 7.7) craft cms arbitrary system file vulnerability (CWE-552: Files or Directories Accessible to External Parties) affecting Craftcms/cms libraries in the Packagist ecosystem. The issue involves craft cms arbitrary system file read. Remediation is available by upgrading affected packages to version 5.4.9, 4.12.8.
CVE-2024-52292 at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N).
How to Fix CVE-2024-52292
To remediate this vulnerability, upgrade all affected Craftcms/cms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade craftcms/cms to 5.4.9
Upgrade craftcms/cms to 4.12.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for craftcms/cms
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-52292, inspect your project dependencies for Craftcms/cms:
inspect dependencies for craftcms/cms
Analyze the terminal output to locate any version of Craftcms/cms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.9), 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-552: Files or Directories Accessible to External Parties, where the product makes files or directories accessible to unauthorized actors, even though they should not be. In Craftcms/cms, 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
CVE-2024-52292 Affected Craftcms/cms Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
craftcms/cms
|
Packagist |
≥ 5.0.0-alpha.1
< 5.4.9
|
5.4.9
|
|
craftcms/cms
|
Packagist |
≥ 3.5.13
< 4.12.8
|
4.12.8
|
References
Frequently Asked Questions
What is CVE-2024-52292?
Which Craftcms/cms versions are affected?
What version fixes CVE-2024-52292?
Is craftcms/cms affected?
What is the CVSS score of CVE-2024-52292?
What CWE is associated with CVE-2024-52292?
How can I check Packagist dependencies for CVE-2024-52292?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cw6g-qmjq-6w2w",
"modified" : "2024-11-13T18:58:35Z",
"published" : "2024-11-13T14:15:39Z",
"aliases" : [ "CVE-2024-52292" ],
"summary" : "Craft CMS Arbitrary System File Read",
"details" : "### Summary\nBy abusing the mail notification template it is possible to read arbitrary operating system files. \n\n### Details\nThe [dataUrl](https://craftcms.com/docs/3.x/dev/functions.html#dataurl) function can be exploited if an attacker has write permissions on system notification templates. This function accepts an absolute file path, reads the file's content, and converts it into a Base64-encoded string. By embedding this function within a system notification template, the attacker can exfiltrate the Base64-encoded file content through a triggered system email notification. Once the email is received, the Base64 payload can be decoded, allowing the attacker to read arbitrary files on the server.\n\nRequirements:\n* write permissions to system notification templates\n* ability to trigger a corresponding system email\n\n### PoC\n1) Modify a template to contain the following twig template string:\n```twig\n{{ dataUrl('/var/www/web/.env') }}\n```\n2) Trigger the corresponding notification email (e.g. by resetting a password)\n3) Receive the email and decode the base64 string\n\nMail received:\n\n\nDecoded string:\n\n\n\n### Impact\n1) Exposure of Sensitive Information: Arbitrary file read can lead to the exposure of sensitive data such as configuration files (e.g., /etc/passwd, .env, config.php), which may contain credentials, API keys, or database passwords. This can provide the attacker with further access to the system or connected services.\n\n2) Privilege Escalation: If the attacker is able to read files that contain privileged information, such as credentials for other systems or applications, they may be able to escalate their privileges beyond what the web admin role originally allowed, potentially gaining full control over the server or other related systems.\n\n3) Server Compromise: Access to files like SSH keys, private certificates, or system configuration files can lead to the complete compromise of the underlying server. With this information, an attacker could remotely log in to the server or impersonate it in secure communications.\n\n4) Exfiltration of User Data: The ability to read arbitrary files may allow an attacker to access user data, such as stored passwords, session tokens, or private information (like uploaded files or logs), leading to a breach of confidentiality and violating privacy regulations (e.g., GDPR).\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "craftcms/cms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0-alpha.1"
}, {
"fixed" : "5.4.9"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.4.7.1"
}
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "craftcms/cms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.5.13"
}, {
"fixed" : "4.12.8"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.12.6.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/craftcms/cms/security/advisories/GHSA-cw6g-qmjq-6w2w"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52292"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/craftcms/cms"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-552" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-13T14:15:39Z",
"nvd_published_at" : "2024-11-13T17:15:12Z"
}
}