bugfix: apply exemplars hint end-to-end and fix safety cap bypass#6559
Merged
zhxiaogg merged 3 commits intografana:mainfrom Mar 3, 2026
Merged
Conversation
| if queryRangeReq.Exemplars == 0 || queryRangeReq.Exemplars > cfg.Metrics.Sharder.MaxExemplars { | ||
| queryRangeReq.Exemplars = cfg.Metrics.Sharder.MaxExemplars | ||
| if err := normalizeRequestExemplars(queryRangeReq, cfg.Metrics.Sharder.MaxExemplars); err != nil { | ||
| return httpInvalidRequest(err), nil |
Contributor
There was a problem hiding this comment.
Worth testing the exception cases, as per annotations
mdisibio
approved these changes
Mar 3, 2026
|
The backport to To backport manually, run these commands in your terminal: git fetch
git switch --create backport-6559-to-release-v2.10 origin/release-v2.10
git cherry-pick -x b13f74291d489672601a10297f8fbcbf7dd19192Resolve the conflicts, then add the changes and run git add . && git cherry-pick --continueIf you have the GitHub CLI installed: git push --set-upstream origin backport-6559-to-release-v2.10
PR_BODY=$(gh pr view 6559 --json body --template 'Backport b13f74291d489672601a10297f8fbcbf7dd19192 from #6559{{ "\n\n---\n\n" }}{{ index . "body" }}')
echo "${PR_BODY}" | gh pr create --title '[release-v2.10] bugfix: apply exemplars hint end-to-end and fix safety cap bypass' --body-file - --label 'backport' --label '' --base release-v2.10 --webOr, if you don't have the GitHub CLI installed (we recommend you install it!): git push --set-upstream origin backport-6559-to-release-v2.10And open a pull request where the |
zhxiaogg
added a commit
to zhxiaogg/tempo
that referenced
this pull request
Mar 10, 2026
…afana#6559) (cherry picked from commit b13f742)
3 tasks
zhxiaogg
added a commit
that referenced
this pull request
Mar 11, 2026
* enhancement: use frontend MaxExemplars config as single source of truth for exemplar limits (#6515) (cherry picked from commit 401698d) * refactor: removed execess exemplars param from CompileMetricsQueryRange (#6538) (cherry picked from commit 61fafe5) * bugfix: apply exemplars hint end-to-end and fix safety cap bypass (#6559) (cherry picked from commit b13f742)
This was referenced Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Two bugs in exemplars hint handling (
with(exemplars=true|false|N)):Safety cap bypass: hint value in CompileMetricsQueryRange was not checked against maxExemplars, allowing users to exceed the max limit.
Hint only affected per-shard collection: the frontend combiner always used the config-level MaxExemplars, so the hint never bounded the total exemplars in the final result.
Fix by moving hint resolution into normalizeRequestExemplars at the frontend handler, where req.Exemplars is set once and flows through the sharder, combiner, and backend uniformly.
Which issue(s) this PR fixes:
Fixes CVE-2026-27878
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]