LiveActive security incident?Get immediate response
CVE Record

CVE-2026-32274: Black: Arbitrary file writes from unsanitized user input in cache file name

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.

HighCVSS 8.7Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

Black, a widely used Python formatter, could write its cache file outside the intended cache location when a specific option value is attacker-controlled. This can let an attacker cause file writes with the permissions of the Black process. The issue affects Black 24.3.0 through versions before 26.3.1 and is fixed in 26.3.1.

Executive priority

Prioritize remediation in shared build systems, CI runners, and services that process untrusted code or user settings. For ordinary trusted developer formatting, urgency is lower but upgrade should still be scheduled promptly because the fix is available.

Technical view

CVE-2026-32274 is a CWE-22 path traversal issue in Black cache filename construction. The --python-cell-magics option was included without sanitization, allowing arbitrary cache file writes when an attacker controls that argument. CVSS v4.0 score is 8.7. Affected versions are >=24.3.0 and <26.3.1.

Likely exposure

Most exposed environments are CI/CD, developer automation, hosted formatting services, or tools that pass user-controlled Black options. Local developer use with trusted configuration is lower risk. Check Python dependency locks, containers, build images, and downstream vendor packages for vulnerable Black versions.

Exploitation context

The provided sources do not show active exploitation, and KEV is false. Exploitation requires control over the --python-cell-magics value used by Black. Impact is file integrity: writes occur with the privileges and filesystem access of the Black process.

Researcher notes

Key evidence comes from the GitHub advisory, CVE record, Black release, commits, and Red Hat references. The vulnerability is limited to cache filename handling tied to --python-cell-magics. Sources confirm affected range and fixed version, but do not provide evidence of exploitation in the wild.

Mitigation direction

  • Upgrade Black to version 26.3.1 or later.
  • Block untrusted users from controlling Black command-line options.
  • Review CI/CD and formatting services for option pass-through.
  • Apply relevant Red Hat errata where Black is vendor-packaged.
  • Check vendor guidance if upgrades are managed through a distribution.

Validation and detection

  • Inventory Black versions in dependency locks and virtual environments.
  • Scan container and CI images for Black >=24.3.0 and <26.3.1.
  • Review automation for use of --python-cell-magics.
  • Confirm Black reports version 26.3.1 or later after remediation.
  • Track Red Hat advisories if using affected downstream packages.
Prepared
Confidence
high
Sources
7

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-22: File access and web shell behavior lookup

File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

File access behavior lookup

The CVE wording references file access or upload behavior, so file telemetry and web shell review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-32274 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.7 (4.0)
Known Exploited
No
Published

Vector: 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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
5Timeline events
2ADP providers
14Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: yesTechnical Impact: partial

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.7CVSS 4.0HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N——GitHub_M
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N3.93.6redhat-SADP

Vulnerability scoring details

Base CVSS 4.0 score

8.7High
CVSS 4.0 vector shape for CVE-2026-32274Attack VectorAttack ComplexityAttack RequirementsPrivileges RequiredUser InteractionVS ConfidentialityVS IntegrityVS AvailabilitySS ConfidentialitySS IntegritySS Availability

Vector: 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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Attack Requirements
NonePresent
Privileges Required
NoneLowHigh
User Interaction
NonePassiveActive
VS Confidentiality
HighLowNone
VS Integrity
HighLowNone
VS Availability
HighLowNone
SS Confidentiality
HighLowNone
SS Integrity
HighLowNone
SS Availability
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
redhat-SADPblack: Black: Arbitrary file writes from unsanitized user input in cache file name
other:Red Hat severity ratingcvssV3_1
  • 2026-03-12T20:01:22.957Z: Reported to Red Hat.
  • 2026-03-12T19:47:07.464Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
psfblack>= 24.3.0, < 26.3.1Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-22 · source CWE mapping

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.