cpython/Lib/test/test_json
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
..
__init__.py
__main__.py
test_decode.py [3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501) 2022-09-02 09:51:49 -07:00
test_default.py
test_dump.py
test_encode_basestring_ascii.py
test_enum.py
test_fail.py
test_float.py
test_indent.py
test_pass1.py
test_pass2.py
test_pass3.py
test_recursion.py bpo-46542: test_json uses support.infinite_recursion() (GH-30972) 2022-01-27 16:57:07 -08:00
test_scanstring.py
test_separators.py
test_speedups.py
test_tool.py bpo-45644: Make json.tool read infile before writing to outfile (GH-29273) (GH-29445) 2021-11-06 19:01:17 +01:00
test_unicode.py