<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Doc/data/python3.8.abi, branch 3.8</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Doc/data/python3.8.abi?h=3.8</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Doc/data/python3.8.abi?h=3.8'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2022-09-05T20:26:09Z</updated>
<entry>
<title>[3.8] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96503)</title>
<updated>2022-09-05T20:26:09Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2022-09-05T20:26:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b5e331fdb38684808ffc540d53e8595bdc408b89'/>
<id>urn:sha1:b5e331fdb38684808ffc540d53e8595bdc408b89</id>
<content type='text'>
* Correctly pre-check for int-to-str conversion

Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =)

The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact.

The justification for the current check. The C code check is:
```c
max_str_digits / (3 * PyLong_SHIFT) &lt;= (size_a - 11) / 10
```

In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is:
$$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$

From this it follows that
$$\frac{M}{3L} &lt; \frac{s-1}{10}$$
hence that
$$\frac{L(s-1)}{M} &gt; \frac{10}{3} &gt; \log_2(10).$$
So
$$2^{L(s-1)} &gt; 10^M.$$
But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check.

&lt;!-- gh-issue-number: gh-95778 --&gt;
* Issue: gh-95778
&lt;!-- /gh-issue-number --&gt;

Co-authored-by: Gregory P. Smith [Google LLC] &lt;greg@krypto.org&gt;
Co-authored-by: Christian Heimes &lt;christian@python.org&gt;
Co-authored-by: Mark Dickinson &lt;dickinsm@gmail.com&gt;</content>
</entry>
<entry>
<title>Add CI step to check changes in the exported ABI (GH-25232)</title>
<updated>2021-04-09T00:33:48Z</updated>
<author>
<name>Pablo Galindo</name>
<email>Pablogsal@gmail.com</email>
</author>
<published>2021-04-09T00:33:48Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=49b7ab1533294529f15f78b65853dcf1fd872909'/>
<id>urn:sha1:49b7ab1533294529f15f78b65853dcf1fd872909</id>
<content type='text'>
</content>
</entry>
</feed>
