Commit 205359b5 authored by Ava Howell's avatar Ava Howell

disallow ./ in siapaths

parent dc6b93e2
......@@ -61,6 +61,10 @@ func validateSiapath(siapath string) error {
return errors.New("directory traversal is not allowed")
}
if strings.Contains(siapath, "./") {
return errors.New("siapath contains invalid characters")
}
return nil
}
......
......@@ -19,6 +19,7 @@ func TestRenterSiapathValidate(t *testing.T) {
{"./invalid/path", false},
{"test/path", true},
{"/leading/slash", false},
{"foo/./bar", false},
{"", false},
}
for _, pathtest := range pathtests {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment