fix: bump black to 26.3.1 (arbitrary file write via cache filename) - #48
ajaiswal-qsi-strand wants to merge 4 commits into
Conversation
Users should pin a more exact version in `pyproject.toml`, if desired
| install_requires=( | ||
| "click>=8", | ||
| "black==25.1.0", | ||
| "black>=26.5.1,<27", |
There was a problem hiding this comment.
This relaxes the version specifier, which is a philosophical change, but users of this library should pin it on their end if desired I think? (nothing in this repo is asserting exact formatting it looks like, eg: tests)
|
The CI failure is unrelated to the Black upgrade. Each matrix job uses This had been masked because the previously resolved tox version skipped missing interpreters by default. The current unpinned tox release correctly treats them as failures. Could you update |
The bare 'tox' command ran the full py310,py311,py312 envlist in every
matrix job, but each job only exposes one interpreter via setup-python.
The previously-pinned tox skipped missing interpreters; the current
unpinned release treats them as failures.
Pair each python-version with a tox-env (3.10->py310, etc.) and run only
that env via 'tox -e ${{ matrix.tox-env }}'.
Verified: 'tox -e py310' runs a single env and passes locally.
Hi, fixed. Each matrix entry now maps its Python version to a single tox env and runs only that one:
This way each job runs only the env matching its installed interpreter, instead of the full |
fix: bump black to 26.3.1 (arbitrary file write via cache filename)
Summary
Bumps the pinned
blackfrom25.1.0to26.3.1to address a security vulnerability, and releases as2.0.1.Why
blackversions< 26.3.1are vulnerable to arbitrary file writes from unsanitized user input in the cache file name (GHSA / Dependabot high-severity advisory). Sincefourmatpinsblackwith an exact version (black==25.1.0), downstream consumers cannot upgrade black without updating fourmat.Changes
setup.py:black==25.1.0→black==26.3.1setup.py:version2.0.0→2.0.1Testing
fourmat check— exit 0 (self-lint passes with black 26.3.1)pytest test/— 5 passedblack --version→ 26.3.1Note: running
fourmat checkon Python 3.10 emits black's standard AST safety-check warning (config targets py312); this is environment-related and non-fatal (exit 0). CI's tox matrix runs py310/311/312 separately.