From: Petr Viktorin Date: Wed, 15 Apr 2026 10:11:10 +0000 (+0200) Subject: [3.13] gh-146333: Fix quadratic regex backtracking in configparser option parsing... X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=a5969e8f0fda37aaf0e2f844fdcfca9d822a70b1;p=thirdparty%2FPython%2Fcpython.git [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> --- diff --git a/Lib/configparser.py b/Lib/configparser.py index 71f842b3902e..3968ac45eed5 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -600,7 +600,9 @@ class RawConfigParser(MutableMapping): \] # ] """ _OPT_TMPL = r""" - (?P