mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-03-01 15:52:43 +00:00
fix: path traversal in web_ui
This commit is contained in:
@@ -37,8 +37,8 @@ async def index_html(rest_of_path: str):
|
||||
"""
|
||||
if rest_of_path.startswith("api") or rest_of_path.startswith("."):
|
||||
raise HTTPException(status_code=404, detail="Not Found")
|
||||
uibase = Path(__file__).parent / "ui/installed/"
|
||||
filename = uibase / rest_of_path
|
||||
uibase = (Path(__file__).parent / "ui/installed/").resolve()
|
||||
filename = (uibase / rest_of_path).resolve()
|
||||
# It's security relevant to check "relative_to".
|
||||
# Without this, Directory-traversal is possible.
|
||||
media_type: str | None = None
|
||||
|
||||
Reference in New Issue
Block a user