Commit 6c54ceb0 authored by Dr. Stefan Schimanski's avatar Dr. Stefan Schimanski

Filter seccomp profile path from malicious .. and /

parent 6489abe8
......@@ -1015,7 +1015,9 @@ func (dm *DockerManager) getSecurityOpt(pod *api.Pod, ctrName string) ([]string,
return nil, fmt.Errorf("unknown seccomp profile option: %s", profile)
}
file, err := ioutil.ReadFile(filepath.Join(dm.seccompProfileRoot, strings.TrimPrefix(profile, "localhost/")))
name := strings.TrimPrefix(profile, "localhost/")
fname := filepath.Join(dm.seccompProfileRoot, filepath.FromSlash(path.Clean("/"+name)))
file, err := ioutil.ReadFile(fname)
if err != nil {
return nil, err
}
......
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