1 parent f287c31 commit 2c83befCopy full SHA for 2c83bef
1 file changed
cms/server/contest/handlers/main.py
@@ -222,9 +222,13 @@ def post(self):
222
if split.scheme or split.netloc or not split.path.startswith("/"):
223
next_page = self.contest_url()
224
elif split.path != "/":
225
- next_page = self.url(*split.path.strip("/").split("/"))
226
- if split.query:
227
- next_page += "?" + split.query
+ path_segments = split.path.strip("/").split("/")
+ if any(segment in ("", ".", "..") for segment in path_segments):
+ next_page = self.contest_url()
228
+ else:
229
+ next_page = self.url(*path_segments)
230
+ if split.query:
231
+ next_page += "?" + split.query
232
else:
233
next_page = self.url()
234
0 commit comments