mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Clean file of .. or ./ before checking Abs.
This commit is contained in:
parent
316e5dd208
commit
8ee280de87
@ -30,7 +30,7 @@ func GetPath(c echo.Context) (string, string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Invalid path. Should be base64 encoded.")
|
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Invalid path. Should be base64 encoded.")
|
||||||
}
|
}
|
||||||
path := string(pathb)
|
path := filepath.Clean(string(pathb))
|
||||||
if !filepath.IsAbs(path) {
|
if !filepath.IsAbs(path) {
|
||||||
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Absolute path required.")
|
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Absolute path required.")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user