Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #45 from jirislav/bind-paths-too-permisive
Browse files Browse the repository at this point in the history
fix: it was possible to bind paths which were not allowed
  • Loading branch information
lox authored Nov 16, 2018
2 parents 2beee6e + 322ae5a commit 83a10bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion director.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func (r *rulesDirector) isBindAllowed(l socketproxy.Logger, bind string, allowed
hostSrc := filepath.FromSlash(path.Clean("/" + chunks[0]))

for _, allowedPath := range allowed {
if strings.HasPrefix(hostSrc, allowedPath) {
if allowedPath == hostSrc || strings.HasPrefix(hostSrc, allowedPath + "/") {
return true, nil
}
}
Expand Down

0 comments on commit 83a10bf

Please sign in to comment.