Sanitize paths before evaluating access to route
This commit is contained in:
committed by
Kevin Minehart
parent
78ca78f5df
commit
89963aca1f
@@ -302,7 +302,15 @@ func (proxy *DataSourceProxy) validateRequest() error {
|
||||
}
|
||||
|
||||
// route match
|
||||
if !strings.HasPrefix(proxy.proxyPath, route.Path) {
|
||||
r1, err := util.CleanRelativePath(proxy.proxyPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r2, err := util.CleanRelativePath(route.Path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !strings.HasPrefix(r1, r2) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user