Security: Fixes for CVE-2025-6197 and CVE-2025-6023 (#108281)
fix(redirect): make validation of redirect uri stricter Co-authored-by: volcanonoodle <114113189+volcanonoodle@users.noreply.github.com>
This commit is contained in:
co-authored by
volcanonoodle
parent
10ff2728a7
commit
0567ef29be
@@ -24,6 +24,7 @@ type Server struct {
|
||||
Mux *web.Mux
|
||||
RouteRegister routing.RouteRegister
|
||||
TestServer *httptest.Server
|
||||
HttpClient *http.Client
|
||||
}
|
||||
|
||||
// NewServer starts and returns a new server.
|
||||
@@ -50,6 +51,7 @@ func NewServer(t testing.TB, routeRegister routing.RouteRegister) *Server {
|
||||
RouteRegister: routeRegister,
|
||||
Mux: m,
|
||||
TestServer: testServer,
|
||||
HttpClient: &http.Client{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +83,7 @@ func (s *Server) NewRequest(method string, target string, body io.Reader) *http.
|
||||
|
||||
// Send sends a HTTP request to the test server and returns an HTTP response.
|
||||
func (s *Server) Send(req *http.Request) (*http.Response, error) {
|
||||
return http.DefaultClient.Do(req)
|
||||
return s.HttpClient.Do(req)
|
||||
}
|
||||
|
||||
// SendJSON sets the Content-Type header to application/json and sends
|
||||
@@ -144,6 +146,7 @@ func requestContextMiddleware() web.Middleware {
|
||||
c.RequestNonce = ctx.RequestNonce
|
||||
c.PerfmonTimer = ctx.PerfmonTimer
|
||||
c.LookupTokenErr = ctx.LookupTokenErr
|
||||
c.UseSessionStorageRedirect = ctx.UseSessionStorageRedirect
|
||||
}
|
||||
|
||||
next.ServeHTTP(w, r)
|
||||
|
||||
Reference in New Issue
Block a user