Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The rough consensus on this is that the complexity and introspection abilities of CPython make for <a href="http://mail.python.org/pipermail/python-dev/2012-March/117175.html" rel="nofollow">unreliable attempts</a> of blacklisting parts of the interpreter. I believe one of the major attempts was tav's <a href="http://tav.espians.com/a-challenge-to-break-python-security.html" rel="nofollow">safelite</a>. It's also not that hard to <a href="http://mail.python.org/pipermail/python-dev/2012-March/117339.html" rel="nofollow">cause CPython to crash</a>, which opens another path to be exploited from running arbitrary code. Avoiding resource exhaustion or CPU-use DoS from arbitrary code is probably impossible to do in-process (you'd need a watchdog, system limits, etc.).</p> <p>Something crucial for people wanting to have sandboxed code execution in Python is to avoid rolling your own (or simply modifying <code>sys</code>, <code>__builtins__</code>): it's very easy to convince yourself it's rock solid and yet miss some obvious workaround that bypasses your protection. Keep in mind Python used to include a module that offered this kind of protection and even that had glaring issues that allowed to escape its restrictions. IIRC, it was vulnerable to fishing non-restricted objects (via introspection) into the restricted environment.</p> <p>That said, <a href="https://github.com/haypo/pysandbox" rel="nofollow">pysandbox</a> is written by a core Python developer who believes it to be safe when restricting e.g. IO (and it incorporates a lot of previous research) and can run in-process like you want (albeit with a few less features, like DoS protections from CPU and memory use).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload