Skip to content

Commit 492de92

Browse files
committed
Ban urls with .. segment
1 parent c62f191 commit 492de92

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func esmRouter(db Database, esmStorage storage.Storage, logger *log.Logger) rex.
7272
pathname := ctx.R.URL.Path
7373

7474
// ban malicious requests
75-
if strings.HasPrefix(pathname, "/.") || strings.HasSuffix(pathname, ".env") || strings.HasSuffix(pathname, ".php") {
75+
if strings.HasSuffix(pathname, ".env") || strings.HasSuffix(pathname, ".php") || strings.Contains(pathname, "/.") {
7676
return rex.Status(404, "not found")
7777
}
7878

0 commit comments

Comments
 (0)