Unverified Commit ca8e2f1e authored by ImanSharaf's avatar ImanSharaf Committed by GitHub

p2p/simulations: escape mockerType value from request (#24822)

Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
parent 256aae0b
......@@ -22,6 +22,7 @@ import (
"context"
"encoding/json"
"fmt"
"html"
"io"
"io/ioutil"
"net/http"
......@@ -336,7 +337,7 @@ func (s *Server) StartMocker(w http.ResponseWriter, req *http.Request) {
mockerType := req.FormValue("mocker-type")
mockerFn := LookupMocker(mockerType)
if mockerFn == nil {
http.Error(w, fmt.Sprintf("unknown mocker type %q", mockerType), http.StatusBadRequest)
http.Error(w, fmt.Sprintf("unknown mocker type %q", html.EscapeString(mockerType)), http.StatusBadRequest)
return
}
nodeCount, err := strconv.Atoi(req.FormValue("node-count"))
......
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