# PYSEC-2021-367 - The module `AccessControl` defines security policies for Python code used in restricted code within…

Source: https://junglewise.ai/threats/pysec-2021-367-the-module-accesscontrol-defines-security-policies-for-6980850d  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-07-30  
License: CC BY 4.0 with a link back

Severity: info · Published 2021-07-30

The module `AccessControl` defines security policies for Python code used in restricted code within Zope applications. Restricted code is any code that resides in Zope's object database, such as the contents of `Script (Python)` objects. The policies defined in `AccessControl` severely restrict access to Python modules and only exempt a few that are deemed safe, such as Python's `string` module. However, full access to the `string` module also allows access to the class `Formatter`, which can be overridden and extended within `Script (Python)` in a way that provides access to other unsafe Python libraries. Those unsafe Python libraries can be used for remote code execution. By default, you need to have the admin-level Zope "Manager" role to add or edit `Script (Python)` objects through the web. Only sites that allow untrusted users to add/edit these scripts through the web - which would be a very unusual configuration to begin with - are at risk. The problem has been fixed in AccessControl 4.3 and 5.2. Only AccessControl versions 4 and 5 are vulnerable, and only on Python 3, not Python 2.7. As a workaround, a site administrator can restrict adding/editing `Script (Python)` objects through the web using the standard Zope user/role permission mechanisms. Untrusted users should not be assigned the Zope Manager role and adding/editing these scripts through the web should be restricted to trusted users only. This is the default configuration in Zope.

Technologies: [Zope (PyPI)](https://junglewise.ai/threats/technologies/zope). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 30 July 2021.

**Which products and versions are affected?** Zope (PyPI) GIT:introduced=0,fixed=b42dd4badf803bb9fb71ac34cd9cb0c249262f2c|ECOSYSTEM:introduced=4.0,fixed=4.3,introduced=5.0,fixed=5.2.

**Is there a fix for This vulnerability?** Yes. Zope (PyPI): upgrade to 5.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected?** Check whether you run Zope (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Zope (PyPI): upgrade to 5.2 or later

  ```sh
  pip install "Zope>=5.2"
  ```


## Affected products

- Zope (PyPI) GIT:introduced=0,fixed=b42dd4badf803bb9fb71ac34cd9cb0c249262f2c|ECOSYSTEM:introduced=4.0,fixed=4.3,introduced=5.0,fixed=5.2

## Related threats

- [PYSEC-2026-2326 - Access control vulnerable to user data deletion by anonynmous users](https://junglewise.ai/threats/cve-2024-51734-access-control-vulnerable-to-user-data-deletion-by-anonynmous)
- [PYSEC-2026-2325 - Information disclosure in AccessControl](https://junglewise.ai/threats/cve-2023-41050-information-disclosure-in-accesscontrol)
- [PYSEC-2026-2077 - Zope vulnerable to Stored Cross Site Scripting with SVG images](https://junglewise.ai/threats/cve-2023-42458-zope-vulnerable-to-stored-cross-site-scripting-with-svg-images)
- [PYSEC-2026-760 - Zope DocumentTemplate package allows unauthenticated write](https://junglewise.ai/threats/cve-2000-0483-zope-documenttemplate-package-allows-unauthenticated-write)
- [PYSEC-2026-761 - Zope Server vulnerable to DoS via header injection](https://junglewise.ai/threats/cve-2002-0687-zope-server-vulnerable-to-dos-via-header-injection)
