Vulnerabilities in pkg:pypi/mjml
PACKAGECVE-2024-26151 is a HIGH (CVSS 8.2) potentially untrusted input is rendered vulnerability (CWE-20: Improper Input Validation) affecting Mjml libraries in the PyPI ecosystem. The issue involves potentially untrusted input is rendered as html in final output. Remediation is available by upgrading affected packages to version 0.11.0.
pkg:pypi/mjml
Vulnerability advisories affecting package pkg:pypi/mjml. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-578p-fxmm-6229 | CVE-2024-26151 | HIGH | Potentially untrusted input is rendered as HTML in final output |
CVE-2024-26151 at a Glance
Security Impact
CVSS: 8.2
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:R/S:C/C:L/I:H/A:L).
How to Fix CVE-2024-26151
To remediate this vulnerability, upgrade all affected Mjml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install mjml>=0.11.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show mjml
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-26151, inspect your installed packages using pip:
pip show mjml
Analyze the terminal output to locate any version of Mjml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.11.0), your application is affected.
Note: The pip show mjml command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Mjml, 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-26151 Affected Mjml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mjml
|
PyPI |
≥ 0.10.0
< 0.11.0
All 1 versions
0.10.0
|
0.11.0
|
References
Frequently Asked Questions
What is CVE-2024-26151?
Which Mjml versions are affected?
What version fixes CVE-2024-26151?
Is mjml affected?
What is the CVSS score of CVE-2024-26151?
What CWE is associated with CVE-2024-26151?
How can I check PyPI dependencies for CVE-2024-26151?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-578p-fxmm-6229",
"modified" : "2024-02-22T21:40:59Z",
"published" : "2024-02-22T21:40:59Z",
"aliases" : [ "CVE-2024-26151" ],
"summary" : "Potentially untrusted input is rendered as HTML in final output",
"details" : "### Impact\n\nAll users of mjml-python who insert untrusted data into mjml templates unless that data is checked in a very strict manner. User input like `<script>` would be rendered as `<script>` in the final HTML output.\n\nThe attacker must be able to control some data which is later injected in an mjml template which is then send out as email to other users. The attacker could control contents of email messages sent through the platform.\n\n### Patches\n\nThe problem has been fixed in version 0.11.0 of this library. Versions before 0.10.0 are not affected by this security issue which was added as part of commit 84c495da20a91640a1ca551ace17df7f3be644aa.\n\n\n### Workarounds\n\n- Ensure that potentially untrusted user input does not contain any sequences which could be rendered as HTML. \n\n\n### References\n\n- Initial issue report by @sh-at-cs in #52\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "mjml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.10.0"
}, {
"fixed" : "0.11.0"
} ]
} ],
"versions" : [ "0.10.0" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/FelixSchwarz/mjml-python/security/advisories/GHSA-578p-fxmm-6229"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-26151"
}, {
"type" : "WEB",
"url" : "https://github.com/FelixSchwarz/mjml-python/issues/52"
}, {
"type" : "WEB",
"url" : "https://github.com/FelixSchwarz/mjml-python/commit/84c495da20a91640a1ca551ace17df7f3be644aa"
}, {
"type" : "WEB",
"url" : "https://github.com/FelixSchwarz/mjml-python/commit/8d410b7a500703080bb14ed7e3d2663fe16767e6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/FelixSchwarz/mjml-python"
}, {
"type" : "WEB",
"url" : "https://github.com/FelixSchwarz/mjml-python/releases/tag/v0.11.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-02-22T21:40:59Z",
"nvd_published_at" : "2024-02-22T19:15:09Z"
}
}