Skip to content

← Public intelligence

PyPI package

black

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

4 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. High, CVSS 8.7PyPIAmendedPublished

    Black: GitHub Action installs unvalidated required-version from pyproject.toml

    CVE-2026-114134 · GHSA-cg8m-r9f2-5wm2

    Affected
    • PyPI black < 26.10.1
    Fixed in
    26.10.1· Vendor fix available
    Issue
    The GitHub Action bundled with Black can read the version from tool.black.required-version if usepyproject is set to True. This version is not validated and therefore can be used to execute untrusted code in the context of a victim's repository. Details This is similar to the previous CVE-2026-31900. The value in tool.black.required-version is accepted as the version to be installed by the action without validation. Proof of concept Reproduction requires a victim to use Black's GitHub Action with usepyproject: true. The attacker would then issue a PR to the victim's repository with pyproject.toml edited so that Black points to a malicious repository. Impact This is a remote code execution vulnerability impacting users using the GitHub Action bundled with psf/black and using the usepyproject: true setting.

    Recommended action: Upgrade to 26.10.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  2. High, CVSS 8.7PyPIAmendedPublished

    Black: Arbitrary file writes from unsanitized user input in cache file name

    CVE-2026-32274 · GHSA-3936-cmfr-pm3m

    Affected
    • PyPI black >= 24.3.0, < 26.3.1
    Fixed in
    26.3.1· Vendor fix available
    Issue
    Impact 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. Patches Fixed in Black 26.3.1. Workarounds Do not allow untrusted user input into the value of the --python-cell-magics option.

    Recommended action: Upgrade to 26.3.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. High, CVSS 8.7PyPIAmendedPublished

    Black's vulnerable version parsing leads to RCE in GitHub Action

    CVE-2026-31900 · GHSA-v53h-f6m7-xcgm

    Affected
    • PyPI black < 26.3.0
    Fixed in
    26.3.0· Vendor fix available
    Issue
    Impact Black provides a GitHub action for formatting code. This action supports an option, usepyproject: true, for reading the version of Black to use from the repository pyproject.toml. A malicious pull request could edit pyproject.toml to use a direct URL reference to a malicious repository. This could lead to arbitrary code execution in the context of the GitHub Action. Attackers could then gain access to secrets or permissions available in the context of the action. Patches Version 26.3.0 fixes this vulnerability by tightening the validation of the version field. Users who use the GitHub Action as psf/black@stable will automatically pick up this update. Workarounds Do not use the usepyproject: true option in the psf/black GitHub Action.

    Recommended action: Upgrade to 26.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. Medium, CVSS 5.3PyPIAmendedPublished

    Black vulnerable to Regular Expression Denial of Service (ReDoS)

    CVE-2024-21503 · GHSA-fj7x-q9j7-g6q6

    Affected
    • PyPI black < 24.3.0
    Fixed in
    24.3.0· Vendor fix available
    Issue
    Versions of the package black before 24.3.0 are vulnerable to Regular Expression Denial of Service (ReDoS) via the lineswithleadingtabsexpanded function in the strings.py file. An attacker could exploit this vulnerability by crafting a malicious input that causes a denial of service. Exploiting this vulnerability is possible when running Black on untrusted input, or if you habitually put thousands of leading tab characters in your docstrings.

    Recommended action: Upgrade to 24.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →