diff options
author | 2024-10-03 19:35:42 +0100 | |
---|---|---|
committer | 2024-10-03 21:24:46 +0100 | |
commit | f957648d8facd2f731e327c5cdced6532dfd5953 (patch) | |
tree | 0fc66e8a4ea423d9e8cd281719b04e5a7c245e44 | |
parent | Add additional tests to ensure invalid binary paths are not ran (diff) |
Drop restriction of only running binaries from /lang
-rw-r--r-- | snekbox/api/resources/eval.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py index 98babc9..d083b19 100644 --- a/snekbox/api/resources/eval.py +++ b/snekbox/api/resources/eval.py @@ -128,11 +128,8 @@ class EvalResource: binary_path = body.get("binary_path") if binary_path: binary_path = Path(binary_path) - if ( - not binary_path.resolve().as_posix().startswith("/lang/") - or not binary_path.is_file() - ): - raise falcon.HTTPBadRequest(title="binary_path file is invalid") + if not binary_path.is_file(): + raise falcon.HTTPBadRequest(title="binary_path is not a file") try: result = self.nsjail.python3( |