aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ionite34 <[email protected]>2022-12-04 10:18:07 +0800
committerGravatar ionite34 <[email protected]>2022-12-04 10:18:07 +0800
commit81e39d24501bc246807ded02c7d3132cbab14b5d (patch)
treeefda1bc7f6b4951639812e39b8bebb77ec8242a8
parentAdd tests for test_eval 200 (diff)
Update path regex
-rw-r--r--snekbox/api/resources/eval.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py
index 28b739d..9a53577 100644
--- a/snekbox/api/resources/eval.py
+++ b/snekbox/api/resources/eval.py
@@ -36,8 +36,8 @@ class EvalResource:
"properties": {
"path": {
"type": "string",
- # Disallow single absolute paths, and null bytes
- "pattern": r"^[^/\\0].*",
+ # Disallow starting with / or containing \0 anywhere
+ "pattern": r"^(?!/)(?!.*\\0).*$",
},
"content": {"type": "string"},
},