diff --git a/internal/controlplane/handlers_evalstatus.go b/internal/controlplane/handlers_evalstatus.go index ab2a399742..1e9e16c0f4 100644 --- a/internal/controlplane/handlers_evalstatus.go +++ b/internal/controlplane/handlers_evalstatus.go @@ -37,6 +37,10 @@ import ( const ( defaultPageSize uint64 = 25 + // Maximum page size has a conservative value at the moment, + // we can raise it once we have more insight on its + // performance impact. + maxPageSize uint64 = 25 ) // ListEvaluationHistory lists current and past evaluation results for @@ -63,6 +67,10 @@ func (s *Server) ListEvaluationHistory( size = in.GetCursor().GetSize() } + if size > maxPageSize { + return nil, status.Error(codes.InvalidArgument, "invalid cursor") + } + // process filter opts := []history.FilterOpt{} opts = append(opts, FilterOptsFromStrings(in.GetEntityType(), history.WithEntityType)...)