[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread James Davis
James Davis added the comment: Thanks for your thoughts, Raymond. I understand that the alternation has "short-circuit" behavior, but I still find it confusing in this case. Consider these two: Regex patternmatched? matched string capture

[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread James Davis
New submission from James Davis : I have two regexes: /(a|ab)*?b/ and /(ab|a)*?b/. If I re.search the string "ab" for these regexes, I get inconsistent behavior. Specifically, /(a|ab)*?b/ matches with capture "a", while /(ab|a)*?b/ matches with an empty capture group. I

[issue32997] Catastrophic backtracking in fpformat

2018-03-05 Thread James Davis
James Davis <davis...@vt.edu> added the comment: Equivalent, probably cleaner. Comment on the PR if you want a change. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32997] Catastrophic backtracking in fpformat

2018-03-05 Thread James Davis
Change by James Davis <davis...@vt.edu>: -- keywords: +patch pull_requests: +5750 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32997] Catastrophic backtracking in fpformat

2018-03-05 Thread James Davis
New submission from James Davis <davis...@vt.edu>: The decoder regex used to parse numbers in the fpformat module is vulnerable to catastrophic backtracking. '^([-+]?)0*(\d*)((?:\.\d*)?)(([eE][-+]?\d+)?)$' The substructure '0*(\d*)' is quadratic. An attack string like '+0000++' bl

[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-01 Thread James Davis
New submission from James Davis <davis...@vt.edu>: Hi Python security team, My name is James Davis. I'm a security researcher at Virginia Tech. The python core (cpython) has 2 regular expressions vulnerable to catastrophic backtracking that look like potential DOS vectors. The vuln