1 of 20

Python security issues

...a lightning talk at PyCon PL 2019

(14/09/2019)

by Disconnect3d

2 of 20

3 of 20

Who has ever �been there?

4 of 20

Who has ever �been there?

5 of 20

As of today there �are 61 open “security” issues

6 of 20

I looked at *some*�of them

7 of 20

8 of 20

TLDR: it’s about logging.config.listen()

...which listens on 127.0.0.1:PORT�And may use eval on the input

9 of 20

10 of 20

TLDR:� tempfile.NamedTemporaryFile(prefix=..., suffix=...)

...both kwargs allows path traversing

(so you can create a temporary file anywhere)

11 of 20

12 of 20

https://bugs.python.org/issue34915

TLDR:�Another users [on the machine] can steal your�saved cookies :(

* or through a path traversal attack...

13 of 20

14 of 20

https://bugs.python.org/issue33213

TLDR:�Be careful with crypt.crypt(...) on MacOS !

15 of 20

https://bugs.python.org/issue33213

TLDR:�Be careful with crypt.crypt(...) on MacOS !

16 of 20

https://bugs.python.org/issue33213

TLDR:�Be careful with crypt.crypt(...) on MacOS !

^DEMO

17 of 20

???

Python interpreter uses whatever libreadline library it founds, even in a current dir…

* Found in the tracker, couldn’t find the issue number...

18 of 20

???

Python interpreter uses whatever libreadline library it founds, even in a current dir…

* Found in the tracker, couldn’t find the issue number...

19 of 20

???

Python interpreter uses whatever libreadline library it founds, even in a current dir…

* Found in the tracker, couldn’t find the issue number...

Let’s demo

20 of 20

And that’s all, thanks o/

See also

https://bugs.python.org/

;)

by Disconnect3d

slides will be at https://disconnect3d.pl/talks