Giter Club home page Giter Club logo

elisp-sandbox's People

Contributors

dcluna avatar joelmccracken avatar nicferrier avatar purcell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

elisp-sandbox's Issues

DoS attack vectors

Do you have any thoughts on DoS attack vectors? I'm especially concerned about specifics to the implementation of Emacs which makes some things problematic.

One thing that comes to mind, for example, is how Ruby doesn't garbage collect symbols. Thus, if untrusted code can create symbols, we have a DoS attack.

This seems really similar to Emacs' obarray. If we ever provided anything like setq for the users, we need to be careful not to actually add content obarray, or if we do, to make sure it gets cleaned up afterwards.

Any thoughts?

evaling

The point of this is to allow evaling lisp safely.

We currently do not have an eval. Erbot's is just:

(defun fsi-eval (expr)
  (eval
   (erblisp-sandbox expr)))

which makes total sense. We should be able to do the same. However, erbot has a whole bunch of predefined macros and functions that implement the rest of the jail. Most of the things you raised concerns about on the README could be handled here. For example, here's the while:

(defmacro fs-while (cond &rest body)
  `(let
       ((erbn-while-ctr 0))
     (while
     ,cond
       ;; this should enable the with-timeout checks..
       (sleep-for 0.01)
       (if (> erbn-while-ctr erbn-while-max)
       (error "Max while iterations exceeded: %S"
          erbn-while-ctr))
       (incf erbn-while-ctr)
       nil
       ,@body)))

Note how it adds the sleep-for?

Now personally, what I'd like to do is ensure that file and network stuff is handled but run the actual lisp in a child emacs with a timeout, so we don't have to worry about this stuff (whether a while loop is malicious or impractical).

The other thing I'd like is for this stuff to be per-jail. So I should be able to create one jail with one set of bindings and another jail with another. That could just be flet's I suppose.

But anyway, we somehow need to make a start on this. My actor system is coming along so that would be the way to jail the process... but jailing the lisp needs all those functions from erbot that deal with implementing the lisp jail pulled in to your sandbox code.

I'll try and send you patches but if you're going to work on it too that would be exciting!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.