Skip to content

Escape OData filter input in msbench eval metrics#2745

Open
fallintoplace wants to merge 2 commits into
microsoft:mainfrom
fallintoplace:fix/msbench-odata-filter-escaping
Open

Escape OData filter input in msbench eval metrics#2745
fallintoplace wants to merge 2 commits into
microsoft:mainfrom
fallintoplace:fix/msbench-odata-filter-escaping

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • Escapes user-provided benchmark and model query values in GET /api/msbench-eval-metrics with the existing OData literal pattern (' -> '') to prevent broken queries from malformed values.
  • Sanitizes filter construction in dashboard/api/src/functions/getMsbenchEvalMetrics.ts.
  • Replaces user-visible raw exception text with generic error messages and logs detailed errors server-side via context.error.

Testing

  • Not run (not requested).

Copilot AI review requested due to automatic review settings July 4, 2026 22:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the GET /api/msbench-eval-metrics Azure Function by escaping user-provided benchmark and model query parameters before embedding them into an OData filter, and by returning generic 500-level error payloads instead of raw exception messages.

Changes:

  • Added odataLiteral() helper to escape single quotes for OData string literals and applied it to benchmark/model filter clauses.
  • Replaced context.log(... err.message) with context.error(...) and changed client-facing 500 responses to generic error messages.

};
} catch (err: any) {
context.log("Error querying eval metrics:", err.message);
context.error("Error querying eval metrics:", err?.message ?? err);
};
} catch (err: any) {
context.log("Error querying eval filters:", err.message);
context.error("Error querying eval filters:", err?.message ?? err);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants