```elixir
<gniquil> ~~ FIle.read!("../.mix")
[17:46:15] <beamie> ** (UndefinedFunctionError) undefined function: FIle.read!/1 (module FIle is not available)
[17:46:15] <beamie> FIle.read!("../.mix")
[17:46:15] <beamie> (stdlib) erl_eval.erl:657: :erl_eval.do_apply/6
[17:46:15] <beamie> Output truncated: https://gist.github.com/63bd16a36f3635e42ff6
```
How was this done? But if this was done, how come this works?
```elixir
~~ File.ls("..")
<beamie> {:ok,
[17:45:12] <beamie> ["home", ".dockerenv", ".dockerinit", "etc", "dev", "tmp", ".mix", "usr",
[17:45:12] <beamie> "lib", "var", "sbin", "sys", "root", "srv", "bin", "mnt", "boot", "media",
[17:45:12] <beamie> Output truncated: https://gist.github.com/6463c9187cd74919c944
```
Frank
beamie does not blacklist calls, you misspelled File as FIle and you cannot call File.read! on a directory. Instead beamie performs sandboxing by executing every command in a new docker container.
You can perform sandboxing by traversing the AST from Code.string_to_quoted and only accept a subset of “safe” expressions which you pass to Code.eval_quoted. This is very hard to do though and it’s easy to miss edge cases, it would be much safer to use an approach similar to beamie’s.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/fbda5eec-7ae2-48f8-a4fd-25fd842e1f3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.