Friday 5:10 p.m.–5:40 p.m.

Building and breaking a Python sandbox

Jessica McKellar

Audience level:
Intermediate
Category:
Python Core (language, stdlib, etc.)

Description

What does it take to make a Python sandbox that can run untrusted code? Learn some surprising language features and experience security challenges first-hand as we work through building a Python sandbox from scratch. You'll leave this talk with renewed appreciation for the dynamic nature of Python, some sneaky language tricks, and a solid background in classes of sandboxing security issues.

Abstract

What does it take to make a Python sandbox that can run untrusted code? Learn some surprising language features and experience the security challenges first-hand as we work through building a Python sandbox from scratch, finding new ways to escape it at each turn. You'll leave this talk with renewed appreciation for the dynamic nature of Python, some sneaky language tricks, and a solid grounding in the classes of security concerns sandboxed environments have to consider through concrete examples, building from the simplest cases up through quite sophisticated exploits. Throughout the talk we take inspiration from the excellent [pysandbox][1] and [PyPy sandbox][2] projects, as well as some devious historical Capture the Flag challenges involving breaking out of flawed sandboxes. [1]: https://github.com/haypo/pysandbox [2]: http://doc.pypy.org/en/latest/sandbox.html