Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sandboxing around Triplestore.eval_function() #167

Open
jesper-friis opened this issue Jan 24, 2024 · 0 comments
Open

Add sandboxing around Triplestore.eval_function() #167

jesper-friis opened this issue Jan 24, 2024 · 0 comments

Comments

@jesper-friis
Copy link
Contributor

jesper-friis commented Jan 24, 2024

The current implementation trust that mapping functions does not have unwanted side effects. This is a security issue.

To fix this, evaluate mapping functions in a secure sandbox. It can be assumed that a mapping function is a pure function with no side effect.

One should think that safe evaluation of a python function would be a common request that there would be a standard solution for. But I couldn't find any up-to-date package for it.

A possible solution could be to evaluate the mapping function in another python interpreter running in a chroot environment in a docker image with no network. Arguments could be pickled and send via stdin. For the return value, it would be safer to require that it must be json serialisable, since it is possible to execute arbitrary code during unpickling.

Some references:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant