Skip to content

Commit

Permalink
resolve the template folder path (#2390)
Browse files Browse the repository at this point in the history
on macOS the /tmp and /var are symlinks to /private/tmp and /private/var, which causes problems when resolving relative paths.
  • Loading branch information
vigsterkr committed Oct 7, 2021
1 parent c92c5f0 commit 1009fd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion renku/service/controllers/templates_read_manifest.py
Expand Up @@ -58,7 +58,9 @@ def template_manifest(self):
continue

# NOTE: prevent path traversal attack
icon_path = template_folder / ((template_folder / template["icon"]).resolve().relative_to(template_folder))
icon_path = template_folder / (
(template_folder / template["icon"]).resolve().relative_to(template_folder.resolve())
)

icon = Image.open(icon_path)
icon.thumbnail(MAX_ICON_SIZE)
Expand Down

0 comments on commit 1009fd8

Please sign in to comment.