meshery/meshery

[Performance] Validate SMP clients and endpoint lists before indexing

Open

#18.979 aberto em 29 de abr. de 2026

Ver no GitHub
 (1 comment) (1 reaction) (1 assignee)HTML (3.101 forks)batch import
help wanted

Métricas do repositório

Stars
 (10.013 stars)
Métricas de merge de PR
 (Mesclagem média 22d 16h) (332 fundiu PRs em 30d)

Description

Current Behavior

LoadTestUsingSMPHandler assumes that perfTest.Config.Clients[0] and testClient.EndpointUrls[0] always exist.

If an SMP payload omits clients or endpoints, the handler can panic with an index-out-of-range error instead of returning a validation error to the caller.

Expected Behavior

The handler should validate that at least one client and one endpoint are present before indexing into either slice, and it should return a clear 4xx response when they are missing.

Screenshots/Logs

Relevant code path:

  • server/handlers/load_test_handler.go
  • testClient := perfTest.Config.Clients[0]
  • loadTestOptions.URL = testClient.EndpointUrls[0]

Environment

  • Host OS: Linux
  • Platform: Kubernetes
  • Meshery Server Version: current master
  • Meshery Client Version: current master

To Reproduce

  1. POST an SMP config with an empty clients list, or with a client that has an empty endpointUrls list.
  2. Hit the performance test endpoint.
  3. Observe a server-side panic instead of a user-facing validation error.

Contributor Guides and Handbook

Guia do colaborador