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.
A fix will be introduced in the versions 4.4, 5.8 and 6.2.
There are no workarounds.
https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67 describes the corresponding problem for RestrictedPython.
{
"github_reviewed": true,
"cwe_ids": [
"CWE-200"
],
"github_reviewed_at": "2023-09-07T12:56:39Z",
"nvd_published_at": "2023-09-06T18:15:08Z",
"severity": "MODERATE"
}