black — security advisory
Black is the uncompromising Python code formatter. Starting in version 24.3.0 and prior to version 26.3.1, Black writes a cache file, the name of which is computed from various formatting options. The value of the --python-cell-magics option was placed in the filename without sanitization, which allowed an attacker who controls the value of this argument to write cache files to arbitrary file system locations. Fixed in Black 26.3.1.
- Products
- black
- Affected versions
- 19.3b0-1, 20.8b1-4, 21.10b0-1, 21.12b0-1, 21.4b2-3, 23.10.1-1, 23.11.0-1, 23.7.0-1, 24.2.0-1ubuntu1, 25.1.0-2, 25.1.0-3, 25.11.0-1, 25.12.0-1, 25.9.0-1, 26.1.0-1, 26.1.0-1build1, 26.3.1-1, 26.5.1-1
- Fixed versions
- Not specified
- CVEs
- CVE-2026-32274
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 02:07 UTC · Revision 1
Source evidence
Black is the uncompromising Python code formatter. Starting in version 24.3.0 and prior to version 26.3.1, Black writes a cache file, the name of which is computed from various formatting options. The value of the --python-cell-magics option was placed in the filename without sanitization, which allowed an attacker who controls the value of this argument to write cache files to arbitrary file system locations. Fixed in Black 26.3.1.
osv:UBUNTU-CVE-2026-32274
black
Fixed versions: Not specified
black
Fixed versions: Not specified
black
Fixed versions: Not specified
black
Fixed versions: Not specified
black
Fixed versions: Not specified
black
Fixed versions: Not specified
Complete source record
{
"id": "78a7b980bbec24c7ad705df7b235ece5868b7214bd8ce212f0124200ad80842f",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-32274",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2026-32274",
"summary": "Black is the uncompromising Python code formatter. Starting in version 24.3.0 and prior to version 26.3.1, Black writes a cache file, the name of which is computed from various formatting options. The value of the --python-cell-magics option was placed in the filename without sanitization, which allowed an attacker who controls the value of this argument to write cache files to arbitrary file system locations. Fixed in Black 26.3.1.",
"evidence": "osv:UBUNTU-CVE-2026-32274",
"products": [
{
"name": {
"value": "black",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "19.3b0-1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "black",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "20.8b1-4",
"evidence": "/affected/1/versions"
},
{
"value": "21.4b2-3",
"evidence": "/affected/1/versions"
},
{
"value": "21.10b0-1",
"evidence": "/affected/1/versions"
},
{
"value": "21.12b0-1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "black",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "23.7.0-1",
"evidence": "/affected/2/versions"
},
{
"value": "23.10.1-1",
"evidence": "/affected/2/versions"
},
{
"value": "23.11.0-1",
"evidence": "/affected/2/versions"
},
{
"value": "24.2.0-1ubuntu1",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "black",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "25.1.0-2",
"evidence": "/affected/3/versions"
},
{
"value": "25.1.0-3",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "black",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "26.3.1-1",
"evidence": "/affected/4/versions"
},
{
"value": "26.5.1-1",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "black",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "25.1.0-3",
"evidence": "/affected/5/versions"
},
{
"value": "25.9.0-1",
"evidence": "/affected/5/versions"
},
{
"value": "25.11.0-1",
"evidence": "/affected/5/versions"
},
{
"value": "25.12.0-1",
"evidence": "/affected/5/versions"
},
{
"value": "26.1.0-1",
"evidence": "/affected/5/versions"
},
{
"value": "26.1.0-1build1",
"evidence": "/affected/5/versions"
},
{
"value": "26.3.1-1",
"evidence": "/affected/5/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "UBUNTU-CVE-2026-32274",
"aliases": [
"UBUNTU-CVE-2026-32274"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
},
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
},
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "black",
"purl": "pkg:deb/ubuntu/black?arch=source&distro=focal",
"ecosystem": "Ubuntu:20.04:LTS"
},
"versions": [
"19.3b0-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-32274.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "19.3b0-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "black",
"purl": "pkg:deb/ubuntu/black?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"20.8b1-4",
"21.4b2-3",
"21.10b0-1",
"21.12b0-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-32274.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "21.12b0-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "black",
"purl": "pkg:deb/ubuntu/black?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"23.7.0-1",
"23.10.1-1",
"23.11.0-1",
"24.2.0-1ubuntu1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-32274.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "24.2.0-1ubuntu1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "black",
"purl": "pkg:deb/ubuntu/black?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"25.1.0-2",
"25.1.0-3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-32274.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "25.1.0-3"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "black",
"purl": "pkg:deb/ubuntu/black?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"26.3.1-1",
"26.5.1-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-32274.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "26.5.1-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "black",
"purl": "pkg:deb/ubuntu/black?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"25.1.0-3",
"25.9.0-1",
"25.11.0-1",
"25.12.0-1",
"26.1.0-1",
"26.1.0-1build1",
"26.3.1-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-32274.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "26.3.1-1"
}
]
}
}
],
"modified": "2026-10-17T12:58:09.378050332Z",
"provider": "osv",
"upstream": [
"CVE-2026-32274"
],
"references": [
"https://ubuntu.com/security/CVE-2026-32274",
"https://www.cve.org/CVERecord?id=CVE-2026-32274",
"https://github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3m",
"https://github.com/psf/black/pull/5038"
]
},
"related_cves": [
{
"value": "CVE-2026-32274",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 358241,
"published_at": "2026-03-12T20:16:00+00:00"
}