CVE-2021-32633: Zope Remote Code Execution Vulnerability
HIGHCVE-2021-32633 is a HIGH (CVSS 6.8) remote code execution vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Zope libraries in the PyPI ecosystem. The issue involves remote code execution via traversal in tal expressions. Remediation is available by upgrading affected packages to version 4.6, 5.2.
CVE-2021-32633 at a Glance
Security Impact
CVSS: 6.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2021-32633
To remediate this vulnerability, upgrade all affected Zope 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 Zope>=4.6
pip install Zope>=5.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Zope
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-32633, inspect your installed packages using pip:
pip show Zope
Analyze the terminal output to locate any version of Zope in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6), your application is affected.
Note: The pip show Zope command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Zope, 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-2021-32633 Affected Zope Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2021-32633?
Which Zope versions are affected?
What version fixes CVE-2021-32633?
Is Zope affected?
What is the CVSS score of CVE-2021-32633?
What CWE is associated with CVE-2021-32633?
How can I check PyPI dependencies for CVE-2021-32633?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5pr9-v234-jw36",
"modified" : "2024-11-19T18:29:40Z",
"published" : "2021-06-18T18:44:01Z",
"aliases" : [ "CVE-2021-32633" ],
"summary" : "Remote Code Execution via traversal in TAL expressions",
"details" : "### Impact\nMost Python modules are not available for using in TAL expressions that you can add through-the-web, for example in Zope Page Templates. This restriction avoids file system access, for example via the 'os' module. But some of the untrusted modules are available indirectly through Python modules that are available for direct use.\n\nBy default, you need to have the Manager role to add or edit Zope Page Templates through the web. Only sites that allow untrusted users to add/edit Zope Page Templates through the web are at risk.\n\n### Patches\nThe problem has been fixed in Zope 5.2 and 4.6.\n\n### Workarounds\nA site administrator can restrict adding/editing Zope Page Templates through the web using the standard Zope user/role permission mechanisms. Untrusted users should not be assigned the Zope Manager role and adding/editing Zope Page Templates through the web should be restricted to trusted users only.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in the [Zope issue tracker](https://github.com/zopefoundation/Zope/issues)\n* Email us at [security@plone.org](mailto:security@plone.org)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Zope"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "Zope"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0"
}, {
"fixed" : "5.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/zopefoundation/Zope/security/advisories/GHSA-5pr9-v234-jw36"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32633"
}, {
"type" : "WEB",
"url" : "https://github.com/zopefoundation/Zope/commit/1f8456bf1f908ea46012537d52bd7e752a532c91"
}, {
"type" : "WEB",
"url" : "https://cyllective.com/blog/post/plone-authenticated-rce-cve-2021-32633"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/zope/PYSEC-2021-88.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/zopefoundation/Zope"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2021/05/21/1"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2021/05/22/1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-21T16:26:15Z",
"nvd_published_at" : null
}
}