]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-146333: Fix quadratic regex backtracking in configparser option parsing (GH-146399)
authorJoshua Swanson <22283299+joshuaswanson@users.noreply.github.com>
Tue, 7 Apr 2026 14:10:34 +0000 (16:10 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Apr 2026 14:10:34 +0000 (16:10 +0200)
commit7e0a0be4097f9d29d66fe23f5af86f18a34ed7dd
treec74913cbb7a27d72824b5b58fb9f1d37c61745af
parentfeee573f36ecdc767d73c95d43e68dd02e41549d
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).
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]