We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b396786 commit bfd234cCopy full SHA for bfd234c
exec_if.go
@@ -74,6 +74,10 @@ func OutputFilter(stdout io.Reader, w http.ResponseWriter) error {
74
75
func splitPathInfo(basedir string, path string, suffix string) (string, string, error) {
76
ret := path
77
+ if strings.Contains(path, "..") {
78
+ slog.Warn("skip suspicious path", "path", path)
79
+ return "", "", fmt.Errorf("not found %s", path)
80
+ }
81
for ret != "" && ret != "." && ret != "/" {
82
slog.Debug("check", "path", path, "basedir", basedir, "cur", ret)
83
if strings.HasSuffix(ret, suffix) {
@@ -122,7 +126,7 @@ func RunBy(opts SrvConfig, runner Runner, w http.ResponseWriter, r *http.Request
122
126
slog.Error("not found", "error", err, "basename", bn)
123
127
span.SetStatus(codes.Error, "not found")
124
128
w.WriteHeader(http.StatusNotFound)
125
- fmt.Fprintln(w, bn, "not found")
129
+ fmt.Fprintln(w, "not found")
130
return err
131
}
132
slog.Debug("memo(path)", "bn", bn, "bn2", bn2, "rest", rest)
0 commit comments