Fix DoS vulnerability in batch evaluation endpoint#649
Merged
zhouzhuojie merged 3 commits intoopenflagr:mainfrom Feb 5, 2026
Merged
Fix DoS vulnerability in batch evaluation endpoint#649zhouzhuojie merged 3 commits intoopenflagr:mainfrom
zhouzhuojie merged 3 commits intoopenflagr:mainfrom
Conversation
Add deduplication for flagKeys and flagIDs to prevent resource exhaustion attacks via the /api/v1/evaluation/batch endpoint where attackers could send the same key repeated thousands of times. Also add optional FLAGR_EVAL_BATCH_SIZE limit (default: 0/disabled) for users who want additional protection against large unique key lists.
624f107 to
91dd09a
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #649 +/- ##
==========================================
- Coverage 81.19% 77.06% -4.14%
==========================================
Files 28 30 +2
Lines 2271 2023 -248
==========================================
- Hits 1844 1559 -285
- Misses 337 373 +36
- Partials 90 91 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Added tests to validate behavior when the evaluation batch size limit is exceeded, not exceeded, and disabled. Updated the evaluation logic to ensure proper deduplication of flagKeys and flagIDs, and to enforce the configured batch size limit for evaluations, improving protection against resource exhaustion attacks.
Enhance batch evaluation handling with size limit checks
zhouzhuojie
approved these changes
Feb 5, 2026
foxdalas
pushed a commit
to foxdalas/flagr
that referenced
this pull request
Feb 7, 2026
* Fix DoS vulnerability in batch evaluation endpoint Add deduplication for flagKeys and flagIDs to prevent resource exhaustion attacks via the /api/v1/evaluation/batch endpoint where attackers could send the same key repeated thousands of times. Also add optional FLAGR_EVAL_BATCH_SIZE limit (default: 0/disabled) for users who want additional protection against large unique key lists. * Enhance batch evaluation handling with size limit checks Added tests to validate behavior when the evaluation batch size limit is exceeded, not exceeded, and disabled. Updated the evaluation logic to ensure proper deduplication of flagKeys and flagIDs, and to enforce the configured batch size limit for evaluations, improving protection against resource exhaustion attacks. --------- Co-authored-by: zhouzhuojie <zhouzhuojie@gmail.com>
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.
Add deduplication for flagKeys and flagIDs to prevent resource exhaustion attacks via the /api/v1/evaluation/batch endpoint where attackers could send the same key repeated thousands of times.
Also add optional FLAGR_EVAL_BATCH_SIZE limit (default: 0/disabled) for users who want additional protection against large unique key lists.
Description
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: