Skip to content
Heist/ feed
Back to feed
HighFix available

restrictedpython — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2023-41039

RestrictedPython is a restricted execution environment for Python to run untrusted code. Python's "format" functionality allows someone controlling the format string to "read" all objects accessible through recursive attribute lookup and subscription from objects he can access. This can lead to critical information disclosure. With `RestrictedPython`, the format functionality is available via the `format` and `format_map` methods of `str` (and `unicode`) (accessed either via the class or its instances) and via `string.Formatter`. All known versions of `RestrictedPython` are vulnerable. This issue has been addressed in commit `4134aedcff1` which has been included in the 5.4 and 6.2 releases. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Products
restrictedpython
Affected versions
4.0~b3-3, 6.2-1, 8.0-1, 8.1-1, 8.4-1
Fixed versions
6.2-1
CVEs
CVE-2023-41039
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 15:58 UTC · Revision 1

Source evidence

DEBIAN-CVE-2023-41039

core-osv · Original source

Published 30 Aug 2023, 18:15 UTC

RestrictedPython is a restricted execution environment for Python to run untrusted code. Python's "format" functionality allows someone controlling the format string to "read" all objects accessible through recursive attribute lookup and subscription from objects he can access. This can lead to critical information disclosure. With `RestrictedPython`, the format functionality is available via the `format` and `format_map` methods of `str` (and `unicode`) (accessed either via the class or its instances) and via `string.Formatter`. All known versions of `RestrictedPython` are vulnerable. This issue has been addressed in commit `4134aedcff1` which has been included in the 5.4 and 6.2 releases. Users are advised to upgrade. There are no known workarounds for this vulnerability.

osv:DEBIAN-CVE-2023-41039

restrictedpython

Fixed versions: Not specified

restrictedpython

Fixed versions: 6.2-1

restrictedpython

Fixed versions: 6.2-1

Complete source record
{
  "id": "9f85f943e0d7e1066dde1f878ea07651289ac4c16b198adeae45c3d69791a146",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2023-41039",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2023-41039",
    "summary": "RestrictedPython is a restricted execution environment for Python to run untrusted code. Python's \"format\" functionality allows someone controlling the format string to \"read\" all objects accessible through recursive attribute lookup and subscription from objects he can access. This can lead to critical information disclosure. With `RestrictedPython`, the format functionality is available via the `format` and `format_map` methods of `str` (and `unicode`) (accessed either via the class or its instances) and via `string.Formatter`. All known versions of `RestrictedPython` are vulnerable. This issue has been addressed in commit `4134aedcff1` which has been included in the 5.4 and 6.2 releases. Users are advised to upgrade. There are no known workarounds for this vulnerability.",
    "evidence": "osv:DEBIAN-CVE-2023-41039",
    "products": [
      {
        "name": {
          "value": "restrictedpython",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "4.0~b3-3",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "6.2-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "8.0-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "8.1-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "8.4-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "restrictedpython",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.2-1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "restrictedpython",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.2-1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2023-41039",
      "aliases": [
        "DEBIAN-CVE-2023-41039"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "restrictedpython",
            "purl": "pkg:deb/debian/restrictedpython?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "versions": [
            "4.0~b3-3",
            "6.2-1",
            "8.0-1",
            "8.1-1",
            "8.4-1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-41039.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "6.2-1"
                }
              ]
            }
          ],
          "package": {
            "name": "restrictedpython",
            "purl": "pkg:deb/debian/restrictedpython?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-41039.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "6.2-1"
                }
              ]
            }
          ],
          "package": {
            "name": "restrictedpython",
            "purl": "pkg:deb/debian/restrictedpython?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-41039.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-26T18:02:33.131677267Z",
      "provider": "osv",
      "upstream": [
        "CVE-2023-41039"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2023-41039"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2023-41039",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 456242,
  "published_at": "2023-08-30T18:15:09.88+00:00"
}