mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
assert sanitized and stripped paths
This commit is contained in:
parent
c08754cf92
commit
5429f5c1a9
19 changed files with 108 additions and 72 deletions
|
@ -48,9 +48,11 @@ class Web(web.BaseWeb):
|
|||
"internal_data")
|
||||
|
||||
def get(self, environ, base_prefix, path, user):
|
||||
assert path == "/.web" or path.startswith("/.web/")
|
||||
assert pathutils.sanitize_path(path) == path
|
||||
try:
|
||||
filesystem_path = pathutils.path_to_filesystem(
|
||||
self.folder, path[len("/.web"):])
|
||||
self.folder, path[len("/.web"):].strip("/"))
|
||||
except ValueError as e:
|
||||
logger.debug("Web content with unsafe path %r requested: %s",
|
||||
path, e, exc_info=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue