Security: Fixes for CVE-2025-6197 and CVE-2025-6023 (#108280)

fix(redirect): make validation of redirect uri stricter

Co-authored-by: volcanonoodle <114113189+volcanonoodle@users.noreply.github.com>
This commit is contained in:
Jev Forsberg
2025-07-17 15:06:45 -06:00
committed by GitHub
co-authored by volcanonoodle
parent 1e9c78656a
commit 988d964200
6 changed files with 147 additions and 11 deletions
+4 -1
View File
@@ -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)