Clean file of .. or ./ before checking Abs. (#456)

This commit is contained in:
2024-04-30 19:04:21 +02:00
committed by GitHub
+1 -1
View File
@@ -30,7 +30,7 @@ func GetPath(c echo.Context) (string, string, error) {
if err != nil {
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Invalid path. Should be base64 encoded.")
}
path := string(pathb)
path := filepath.Clean(string(pathb))
if !filepath.IsAbs(path) {
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Absolute path required.")
}