Arbitrary File Write Vulnerability in Python Code Formatter Black by PSF
CVE-2026-32274
8.7HIGH
What is CVE-2026-32274?
The Black code formatter for Python versions before 26.3.1 has a vulnerability that allows an attacker to create cache files in arbitrary locations on the file system due to unsanitized input from the --python-cell-magics option. This flaw permits potentially malicious users to exploit the file naming mechanism, leading to unauthorized file write operations that can compromise the system's security. The issue was addressed in version 26.3.1, which implemented appropriate input validation.
Affected Version(s)
black >= 24.3.0, < 26.3.1
