cpython/Parser
Gregory P. Smith 8f0fa4bd10
[3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501)
Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds.

This PR comes fresh from a pile of work done in our private PSRT security response team repo.

This backports https://github.com/python/cpython/pull/96499 aka 511ca94520

Signed-off-by: Christian Heimes [Red Hat] <christian@python.org>
Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org>
Reviews via the private PSRT repo via many others (see the NEWS entry in the PR).

<!-- gh-issue-number: gh-95778 -->
* Issue: gh-95778
<!-- /gh-issue-number -->

I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#).
2022-09-02 09:51:49 -07:00
..
asdl.py bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25142) 2021-04-02 12:53:46 +09:00
asdl_c.py bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) 2021-06-03 13:27:00 -07:00
myreadline.c bpo-30555: Fix WindowsConsoleIO fails in the presence of fd redirection (GH-1927) 2021-04-23 23:00:27 +01:00
parser.c [3.10] gh-94996: Disallow lambda pos only params with feature_version < (3, 8) (GH-95934) (GH-95938) 2022-08-12 12:47:07 -07:00
peg_api.c bpo-43244: Remove parser_interface.h header file (GH-25001) 2021-03-24 01:29:09 +01:00
pegen.c [3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501) 2022-09-02 09:51:49 -07:00
pegen.h [3.10] Backport bpo-47212 (GH-32302) to Python 3.10 (GH-32334) 2022-04-05 09:21:49 -07:00
Python.asdl bpo-46289: Make conversion of FormattedValue not optional on ASDL (GH-30467) 2022-01-07 14:30:18 -08:00
string_parser.c gh-94869: Fix the location in some expressions for multi-line f-string ast nodes (GH-94895) (#94911) 2022-07-16 22:06:33 +01:00
string_parser.h bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933) 2021-03-23 20:47:40 +01:00
token.c bpo-43822: Improve syntax errors for missing commas (GH-25377) 2021-04-15 21:38:45 +01:00
tokenizer.c [3.10] gh-94360: Fix a tokenizer crash when reading encoded files with syntax errors from stdin (GH-94386) (GH-94574) 2022-07-05 20:14:28 +02:00
tokenizer.h [3.10] Ensure the str member of the tokenizer is always initialised (GH-29681). (GH-29683) 2021-11-21 04:15:22 +00:00