]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-146333: Fix quadratic regex backtracking in configparser option parsing...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 12 Apr 2026 00:05:10 +0000 (02:05 +0200)
committerGitHub <noreply@github.com>
Sun, 12 Apr 2026 00:05:10 +0000 (00:05 +0000)
commitaf2f5189a12888afa4e93243653c331e9fffddb5
tree32a7abb3ff72a1e22c1173958633dcc6e1b5b8cf
parent4f8a77bf3fa8d0c10ddd50a8dda4ad89e8d2434e
[3.14] gh-146333: Fix quadratic regex backtracking in configparser option parsing (GH-146399) (#148287)

gh-146333: Fix quadratic regex backtracking in configparser option parsing (GH-146399)

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]