chore(deps): update dependency black to v24.3.0 [security]
Metadata
Current evaluation
Merged PR #4686 in commit 06e15b378, updating Black from 24.1.1 to 24.3.0 to remediate CVE-2024-21503 (ReDoS).
Resolution: closed resolved
Reason: PR #4686 was merged as commit 06e15b378. Its dependency pin update installs Black 24.3.0, the first release fixing CVE-2024-21503.
Evaluated by: mr-cal-bot
No scores available.
Issue body
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [black](https://togithub.com/psf/black) ([changelog](https://togithub.com/psf/black/blob/main/CHANGES.md)) | `==24.1.1` -> `==24.3.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
### GitHub Vulnerability Alerts
#### [CVE-2024-21503](https://nvd.nist.gov/vuln/detail/CVE-2024-21503)
Versions of the package black before 24.3.0 are vulnerable to Regular Expression Denial of Service (ReDoS) via the lines_with_leading_tabs_expanded 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.
---
### Release Notes
<details>
<summary>psf/black (black)</summary>
### [`v24.3.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2430)
[Compare Source](https://togithub.com/psf/black/compare/24.2.0...24.3.0)
##### Highlights
This release is a milestone: it fixes Black's first CVE security vulnerability. If you
run Black on untrusted input, or if you habitually put thousands of leading tab
characters in your docstrings, you are strongly encouraged to upgrade immediately to fix
[CVE-2024-21503](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503).
This release also fixes a bug in Black's AST safety check that allowed Black to make
incorrect changes to certain f-strings that are valid in Python 3.12 and higher.
##### Stable style
- Don't move comments along with delimiters, which could cause crashes ([#​4248](https://togithub.com/psf/black/issues/4248))
- Strengthen AST safety check to catch more unsafe changes to strings. Previous versions
of Black would incorrectly format the contents of certain unusual f-strings containing
nested strings with the same quote type. Now, Black will crash on such strings until
support for the new f-string syntax is implemented. ([#​4270](https://togithub.com/psf/black/issues/4270))
- Fix a bug where line-ranges exceeding the last code line would not work as expected
([#​4273](https://togithub.com/psf/black/issues/4273))
##### Performance
- Fix catastrophic performance on docstrings that contain large numbers of leading tab
characters. This fixes
[CVE-2024-21503](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503).
([#​4278](https://togithub.com/psf/black/issues/4278))
##### Documentation
- Note what happens when `--check` is used with `--quiet` ([#​4236](https://togithub.com/psf/black/issues/4236))
### [`v24.2.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2420)
[Compare Source](https://togithub.com/psf/black/compare/24.1.1...24.2.0)
##### Stable style
- Fixed a bug where comments where mistakenly removed along with redundant parentheses
([#​4218](https://togithub.com/psf/black/issues/4218))
##### Preview style
- Move the `hug_parens_with_braces_and_square_brackets` feature to the unstable style
due to an outstanding crash and proposed formatting tweaks ([#​4198](https://togithub.com/psf/black/issues/4198))
- Fixed a bug where base expressions caused inconsistent formatting of \*\* in tenary
expression ([#​4154](https://togithub.com/psf/black/issues/4154))
- Checking for newline before adding one on docstring that is almost at the line limit
([#​4185](https://togithub.com/psf/black/issues/4185))
- Remove redundant parentheses in `case` statement `if` guards ([#​4214](https://togithub.com/psf/black/issues/4214)).
##### Configuration
- Fix issue where *Black* would ignore input files in the presence of symlinks ([#​4222](https://togithub.com/psf/black/issues/4222))
- *Black* now ignores `pyproject.toml` that is missing a `tool.black` section when
discovering project root and configuration. Since *Black* continues to use version
control as an indicator of project root, this is expected to primarily change behavior
for users in a monorepo setup (desirably). If you wish to preserve previous behavior,
simply add an empty `[tool.black]` to the previously discovered `pyproject.toml`
([#​4204](https://togithub.com/psf/black/issues/4204))
##### Output
- Black will swallow any `SyntaxWarning`s or `DeprecationWarning`s produced by the `ast`
module when performing equivalence checks ([#​4189](https://togithub.com/psf/black/issues/4189))
##### Integrations
- Add a JSONSchema and provide a validate-pyproject entry-point ([#​4181](https://togithub.com/psf/black/issues/4181))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "" in timezone Etc/UTC, Automerge - "every weekend" in timezone Etc/UTC.
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/canonical/snapcraft).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI2MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #4686 in commit 06e15b378, updating Black from 24.1.1 to 24.3.0 to remediate CVE-2024-21503 (ReDoS). | |
| stealth/space-bunny-alpha | — | closed resolved | Renovate security bump of black 24.1.1 → 24.3.0 (fixes CVE-2024-21503 ReDoS) merged into main via commit 06e15b378; one-line pin bump in test requirements, approved by 2 reviewers. | |
| stealth/space-bunny-alpha | — | closed resolved | Renovate PR #4686 merged (commit 06e15b378), bumping Black 24.1.1 -> 24.3.0 in pyproject.toml to fix CVE-2024-21503 ReDoS. Approved by 2 reviewers; later superseded by ruff format adoption. | |
| stealth/space-bunny-alpha | — | closed resolved | Renovate PR merged as commit 06e15b378: bumped the black pre-commit pin in .pre-commit-config.yaml from 24.1.1 to 24.3.0, fixing ReDoS CVE-2024-21503. Black was later dropped in favour of ruff format. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #4686 (commit 06e15b378), upgrading Black 24.1.1 to 24.3.0 to address CVE-2024-21503, a ReDoS vulnerability. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged automated dependency update upgrading black from v24.1.1 to v24.3.0 to patch CVE-2024-21503, a ReDoS vulnerability. The change passed CI checks and code coverage before being merged. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged dependency update upgrading black from v24.1.1 to v24.3.0 to patch CVE-2024-21503 ReDoS vulnerability. Changes passed test coverage checks and were successfully merged into main. |
Update history
No update history recorded yet.
Related work
-
Related To:
black#4278
(confidence 99%)
Upstream Black issue for the catastrophic docstring performance fix released in 24.3.0.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #620 chore(deps): update dependency black to v24.8.0 | craft-providers | merged | Merged PR #620 updated Black from 24.4.2 to 24.8.0 via commit 5547eed. | |
| #540 chore(deps): update dependency black to v24 | rockcraft | closed | Black 24.4.0 dependency update was closed unmerged on 19 Apr 2024; Renovate then ignored future 24.x updates pending a manual upgrade. | |
| #176 chore(deps): update dependency black to v24 | starbase | merged | Renovate dependency bump of Black 23.3.0 -> 24.1.1 merged into main via commit 9815d93 (PR #176), a one-line change with 100% coverage retained; black was later removed in favour of ruff. | |
| #1343 chore(deps): update dependency black to v23.10.0 | charmcraft | merged | Merged PR #1343 updated Black from 23.9.1 to 23.10.0 in commit 0a24d7ff. | |
| #1443 chore(deps): update dependency black to v23.12.1 | charmcraft | merged | Merged Black dependency update from 23.11.0 to 23.12.1 in commit 2567c661. | |
| #49 chore(deps): update dependency black to v23.3.0 | starbase | merged | Merged Renovate PR #49 updated Black from 23.1.0 to 23.3.0 via commit fe58f83. | |
| #183 chore(deps): update dependency lint/black to v24 | craft-application | closed | Renovate PR #183 bumping lint/black 23.10.1 -> 24.1.1 was closed unmerged by @lengau on 2024-01-31 as superseded by #185; black v24 landed via merged PR #185 (commit c4fa7570), which also reformatted files. | |
| #1166 chore(deps): update dependency black to v23.7.0 | charmcraft | merged | Renovate dependency bump PR merged into main via commit fa7bbea3 (#1166), raising black from 23.3.0 to 23.7.0 in two dependency declarations (2 files, +2/-2). | |
| #239 chore(deps): update dependency lint/black to v24.2.0 | craft-cli | merged | Renovate PR #239 was merged into main, bumping lint/black from 24.1.1 to 24.2.0 in commit 31a3c48. | |
| #1288 chore(deps): update dependency black to v23.9.1 | charmcraft | closed | Renovate PR to bump black 23.7.0→23.9.1 was closed unmerged; the same upgrade landed in the consolidated "chore(deps): update dependencies" PR #1289 (commit ccc21079), per lengau's comment. |