Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/cli/cmd/llm/benchmark/dashboard/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@ func (s *Server) getExperiment(name string) (*Experiment, error) {
// getResultSummaries returns summaries of all result files in an experiment.
func (s *Server) getResultSummaries(experimentName string) ([]ResultSummary, error) {
expDir := filepath.Join(s.dataDir, experimentName)

// Security check: ensure the path is within dataDir to prevent path traversal
if !s.isPathSafe(expDir) {
return nil, fmt.Errorf("invalid experiment name: path traversal detected")
}

entries, err := os.ReadDir(expDir)
if err != nil {
return nil, err
Expand Down
Loading