CVE-2023-41050: AccessControl Information Disclosure Vulnerability

MODERATE
Advisory Identifier: GHSA-8xv7-89vj-q48c
CVSS 6.8
CWE-200
Published
Advisory Summary

CVE-2023-41050 is a MODERATE (CVSS 6.8) information disclosure vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting AccessControl libraries in the PyPI ecosystem. The issue involves information disclosure in accesscontrol. Remediation is available by upgrading affected packages to version 4.4, 4.8.9, 5.8, 6.2, 5.8.4.

CVE-2023-41050 at a Glance

CVE Identifier CVE-2023-41050
GHSA Identifier GHSA-8xv7-89vj-q48c
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product AccessControl
Package Ecosystem PyPI
Published Date
Last Updated

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:L/PR:H/UI:N/S:C/C:H/I:N/A:N).

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

How to Fix CVE-2023-41050

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

AccessControl fixed: 4.4
pip install AccessControl>=4.4
Zope fixed: 4.8.9
pip install Zope>=4.8.9
AccessControl fixed: 5.8
pip install AccessControl>=5.8
AccessControl fixed: 6.2
pip install AccessControl>=6.2
Zope fixed: 5.8.4
pip install Zope>=5.8.4
Verify Direct and Transitive Dependencies

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

pip show AccessControl

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-41050, inspect your installed packages using pip:

pip show AccessControl

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

Note: The pip show AccessControl command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In AccessControl, 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

### Impact Python's "format" functionality allows someone controlling the format string to "read" objects accessible (recursively) via attribute access and subscription from accessible objects. Those attribute accesses and subscriptions use Python's full blown `getattr` and `getitem`, not the policy restricted `AccessControl` variants `_getattr_` and `_getitem_`. This can lead to critical information disclosure. `AccessControl` already provides a safe variant for `str.format` and denies access to `string.Formatter`. However, `str.format_map` is still unsafe. Affected are all users who allow untrusted users to create `AccessControl` controlled Python code and execute it. ### Patches A fix will be introduced in the versions 4.4, 5.8 and 6.2. ### Workarounds There are no workarounds. ### References https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67 describes the corresponding problem for `RestrictedPython`.

CVE-2023-41050 Affected AccessControl Versions

5 component(s)
Fixed Versions:
4.44.8.95.86.25.8.4
Product / Package Ecosystem Affected Versions Fixed Version
AccessControl
PyPI
< 4.4
4.4
Zope
PyPI
< 4.8.9
4.8.9
AccessControl
PyPI
≥ 5.0
< 5.8
5.8
AccessControl
PyPI
≥ 6.0
< 6.2
6.2
Zope
PyPI
≥ 5.0.0
< 5.8.4
5.8.4

References

Frequently Asked Questions

What is CVE-2023-41050?
CVE-2023-41050 is a security vulnerability in AccessControl involving Information disclosure in AccessControl under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which AccessControl versions are affected?
Affected versions include releases prior to 4.4, 4.8.9, 5.8, 6.2, 5.8.4 across affected packages: AccessControl, Zope.
What version fixes CVE-2023-41050?
Upgrading to 4.4, 4.8.9, 5.8, 6.2, 5.8.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is AccessControl affected?
Yes, AccessControl is affected in releases prior to 4.4, 5.8, 6.2. Upgrade your dependency to 4.4, 5.8, 6.2 or later.
Is Zope affected?
Yes, Zope is affected in releases prior to 4.8.9, 5.8.4. Upgrade your dependency to 4.8.9, 5.8.4 or later.
What is the CVSS score of CVE-2023-41050?
CVE-2023-41050 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2023-41050?
CVE-2023-41050 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check PyPI dependencies for CVE-2023-41050?
Run the dependency tree command: 'pip show AccessControl'. 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-8xv7-89vj-q48c",
  "modified" : "2023-09-07T12:56:39Z",
  "published" : "2023-09-07T12:56:39Z",
  "aliases" : [ "CVE-2023-41050" ],
  "summary" : "Information disclosure in AccessControl",
  "details" : "### Impact\nPython's \"format\" functionality allows someone controlling the format string to \"read\" objects accessible (recursively) via attribute access and subscription from accessible objects. Those attribute accesses and subscriptions use Python's full blown `getattr` and `getitem`, not the policy restricted `AccessControl` variants `_getattr_` and `_getitem_`. This can lead to critical information disclosure.\n\n`AccessControl` already provides a safe variant for `str.format` and denies access to `string.Formatter`. However, `str.format_map` is still unsafe.\n\nAffected are all users who allow untrusted users to create `AccessControl` controlled Python code and execute it.\n\n### Patches\nA fix will be introduced in the versions 4.4, 5.8 and 6.2.\n\n### Workarounds\nThere are no workarounds.\n\n### References\nhttps://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67 describes the corresponding problem for `RestrictedPython`.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "AccessControl"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Zope"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.8.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "AccessControl"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0"
      }, {
        "fixed" : "5.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "AccessControl"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0"
      }, {
        "fixed" : "6.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Zope"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.8.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zopefoundation/AccessControl/security/advisories/GHSA-8xv7-89vj-q48c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41050"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zopefoundation/AccessControl/commit/6bc32692e0d4b8d5cf64eae3d19de987c7375bc9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/zopefoundation/AccessControl"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-07T12:56:39Z",
    "nvd_published_at" : "2023-09-06T18:15:08Z"
  }
}