]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-146333: Fix quadratic regex backtracking in configparser option parsing...
authorPetr Viktorin <encukou@gmail.com>
Wed, 15 Apr 2026 10:11:10 +0000 (12:11 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Apr 2026 10:11:10 +0000 (12:11 +0200)
commita5969e8f0fda37aaf0e2f844fdcfca9d822a70b1
treea34156761e9f16295924e88e1849aab2d5451898
parente76aa128fea8691525b482a211bef6b1c514019d
[3.13] gh-146333: Fix quadratic regex backtracking in configparser option parsing (GH-146399) (GH-148559)

Use negative lookahead in option regex to prevent backtracking, and to avoid changing logic outside the regexes (since people could use the regex directly).
(cherry picked from commit 7e0a0be4097f9d29d66fe23f5af86f18a34ed7dd)

Co-authored-by: Joshua Swanson <22283299+joshuaswanson@users.noreply.github.com>
Lib/configparser.py
Lib/test/test_configparser.py
Misc/NEWS.d/next/Security/2026-03-25-00-51-03.gh-issue-146333.LqdL__bn.rst [new file with mode: 0644]