Skip to content

Commit

Permalink
Browser Workspace: Fix service access check
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorNelson committed Nov 30, 2023
1 parent 7bbc76d commit b0387d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dojo_plugin/pages/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def forward_workspace(service, service_path=""):
abort(403)

elif service.count("~") == 2:
port, user_id, access_code = service.split("~", 2)
service_name, user_id, access_code = service.split("~", 2)
port = service_name
try:
user = Users.query.filter_by(id=int(user_id)).first_or_404()
port = int(port_names.get(port, port))
Expand All @@ -116,7 +117,7 @@ def forward_workspace(service, service_path=""):
container = get_current_container(user)
if not container:
abort(404)
correct_access_code = container_password(container, service)
correct_access_code = container_password(container, service_name)
if not hmac.compare_digest(access_code, correct_access_code):
abort(403)

Expand Down

0 comments on commit b0387d4

Please sign in to comment.