Skip to content

Commit

Permalink
Merge pull request symfony-cli#282 from tucksaun/fix-directory-traversal
Browse files Browse the repository at this point in the history
Prevent directory traversal
  • Loading branch information
fabpot committed Feb 24, 2023
2 parents 2c8b629 + 3a8d989 commit d50c07a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion local/php/envs.go
Expand Up @@ -38,7 +38,7 @@ func (p *Server) generateEnv(req *http.Request) map[string]string {

pathInfo := req.URL.Path
if pos := strings.Index(strings.ToLower(pathInfo), ".php"); pos != -1 {
file := pathInfo[:pos+4]
file := filepath.Clean(pathInfo[:pos+4])
if _, err := os.Stat(filepath.Join(p.documentRoot, file)); err == nil {
scriptName = file
pathInfo = pathInfo[pos+4:]
Expand Down

0 comments on commit d50c07a

Please sign in to comment.