Platform
python
Component
black
Opgelost in
26.3.2
26.3.1
CVE-2026-32274 beschrijft een Arbitrary File Access kwetsbaarheid in Black, een code formatter voor Python. Deze kwetsbaarheid stelt een aanvaller in staat om cachebestanden naar willekeurige locaties op het bestandssysteem te schrijven door de --python-cell-magics optie te beïnvloeden. De kwetsbaarheid treft versies van Black tot en met 26.3.0. Een fix is beschikbaar in Black 26.3.1.
De kwetsbaarheid in Black maakt het mogelijk voor een aanvaller om, door controle te krijgen over de waarde van de --python-cell-magics optie, willekeurige bestanden op het systeem te schrijven. Dit kan leiden tot het overschrijven van kritieke systeembestanden, het uitvoeren van schadelijke code of het verkrijgen van ongeautoriseerde toegang tot gevoelige gegevens. De impact is aanzienlijk, aangezien een succesvolle exploitatie kan resulteren in een compromis van de gehele omgeving waarin Black wordt gebruikt. Het is vergelijkbaar met scenario's waarin een formatter of build tool wordt misbruikt om code-injectie of bestandsoverschrijvingen te veroorzaken.
Deze kwetsbaarheid is openbaar bekend gemaakt op 2026-03-12. Er is momenteel geen informatie beschikbaar over actieve exploits in de wildernis, maar de eenvoud van de exploitatie maakt het waarschijnlijk dat er in de toekomst proof-of-concept exploits beschikbaar komen. De kwetsbaarheid is opgenomen in het CISA KEV catalogus (KEV status onbekend).
Developers and DevOps teams using Black in automated pipelines or CI/CD systems are particularly at risk. Environments where Black is integrated with third-party tools or services that provide untrusted input to the --python-cell-magics option are also vulnerable. Shared hosting environments where multiple users have access to the Black command-line interface should be carefully reviewed.
• python / code formatting:
Get-Process -Name Black | Select-Object -ExpandProperty Path• python / code formatting: Check for unusual cache files in unexpected locations (e.g., /etc/passwd.black_cache).
• python / code formatting: Monitor command-line arguments passed to Black for suspicious paths or characters in the --python-cell-magics option.
• python / code formatting: Review Black configuration files for any hardcoded or default values for --python-cell-magics that could be exploited.
disclosure
Exploit Status
EPSS
0.02% (5% percentiel)
CISA SSVC
Om deze kwetsbaarheid te mitigeren, wordt het sterk aanbevolen om direct te upgraden naar Black versie 26.3.1 of hoger. Indien een upgrade momenteel niet mogelijk is, kan een tijdelijke workaround worden toegepast door te voorkomen dat onbetrouwbare gebruikersinvoer in de --python-cell-magics optie terechtkomt. Dit kan worden bereikt door de optie te valideren of te beperken tot vertrouwde bronnen. Controleer na de upgrade of de kwetsbaarheid is verholpen door een testuitvoering van Black met de --python-cell-magics optie en controleer of de cachebestanden op de verwachte locatie worden geschreven.
Actualice Black a la versión 26.3.1 o superior. Esto corrige la vulnerabilidad que permite la escritura arbitraria de archivos debido a la falta de sanitización en la opción --python-cell-magics.
Kwetsbaarheidsanalyses en kritieke waarschuwingen direct in uw inbox.
CVE-2026-32274 is a HIGH severity vulnerability in Black versions ≤26.3.0 that allows attackers to write cache files to arbitrary locations due to unsanitized input to the --python-cell-magics option.
You are affected if you are using Black versions 26.3.0 or earlier and the --python-cell-magics option is exposed to untrusted input.
Upgrade to Black version 26.3.1 or later. As a temporary workaround, restrict user input to the --python-cell-magics option.
While no active exploitation has been confirmed, the vulnerability's ease of exploitation makes it a potential target.
Refer to the Black project's official release notes and security advisories for details: [https://black.readthedocs.io/en/stable/](https://black.readthedocs.io/en/stable/)
Upload je dependency-bestand en kom direct te weten of deze en andere CVEs jou raken.
Upload je requirements.txt-bestand en we vertellen je direct of je getroffen bent.