-
-
Notifications
You must be signed in to change notification settings - Fork 1
🐛 implement DecodeOptions.list_limit handling in Utils.combine function to prevent DoS via memory exhaustion
#37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
techouse
merged 28 commits into
main
from
fix/implement-list-limit-handling-in-combine-function-to-prevent-DoS-via-memory-exhaustion
Jan 11, 2026
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
59759fe
:bug: implement list limit handling in combine function to prevent Do…
techouse 629fdb8
:arrow_up: bump qs dependency to version 6.14.1
techouse 1461a0d
refactor: improve list handling in combine function to prevent memory…
techouse bf56e62
feat: add OverflowDict to public API for improved list handling
techouse b6fb492
test: add unit tests for OverflowDict handling in combine function
techouse ab775d9
test: add unit tests for OverflowDict handling in merge function
techouse 7176a1c
feat: enhance list limit handling in combine function to prevent memo…
techouse 0147c43
feat: improve list limit handling in combine function to prevent memo…
techouse 17e7d5d
feat: implement list limit handling in combine function to prevent Do…
techouse 5658b19
test: add unit tests for combine function with OverflowDict handling
techouse 260d11d
refactor: remove unused import from utils_test.py
techouse ea95808
feat: skip Undefined values in combine function for list and Overflow…
techouse d32a24b
feat: enhance combine function to skip non-numeric keys and handle Un…
techouse da9341d
test: add tests for list limit handling in combine function to ensure…
techouse fc20217
feat: implement list limit handling in combine function to prevent Do…
techouse 25c4055
feat: optimize overflow handling in combine function by sorting numer…
techouse 685e927
feat: preserve non-numeric keys in merge function of OverflowDict
techouse ab9adb4
feat: update merge function to return OverflowDict when merging with …
techouse ceef2ee
feat: refactor merge logic in Utils to improve handling of overlappin…
techouse 50c930b
feat: enhance combine function to handle list limits and prevent memo…
techouse 9a79f23
feat: add offset handling in combine function to ensure correct index…
techouse 9761e49
feat: remove OverflowDict from public API to streamline package exports
techouse aa8ca11
feat: update merge function to prefer exact key matches over string n…
techouse efdd86b
feat: add tests for list limit handling in combine function to preven…
techouse 2984d57
feat: implement OverflowDict to handle list limit conversions and pre…
techouse 74096fb
refactor: move _numeric_key_pairs function to top-level scope for bet…
techouse e7d2461
feat: update combine function to handle negative list limits correctl…
techouse 1d6e43c
feat: implement deepcopy for OverflowDict to preserve overflow markers
techouse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| """Overflow marker for list limit conversions.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import copy | ||
|
|
||
|
|
||
| class OverflowDict(dict): | ||
| """A mutable marker for list overflows when `list_limit` is exceeded.""" | ||
|
|
||
| def copy(self) -> "OverflowDict": | ||
| """Return an OverflowDict copy to preserve the overflow marker.""" | ||
| return OverflowDict(super().copy()) | ||
|
|
||
| def __copy__(self) -> "OverflowDict": | ||
| """Return an OverflowDict copy to preserve the overflow marker.""" | ||
| return OverflowDict(super().copy()) | ||
|
|
||
| def __deepcopy__(self, memo: dict[int, object]) -> "OverflowDict": | ||
| """Return an OverflowDict deepcopy to preserve the overflow marker.""" | ||
| copied = OverflowDict() | ||
| memo[id(self)] = copied | ||
| for key, value in self.items(): | ||
| copied[copy.deepcopy(key, memo)] = copy.deepcopy(value, memo) | ||
| return copied |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,6 @@ | |
| "author": "Klemen Tusar", | ||
| "license": "BSD-3-Clause", | ||
| "dependencies": { | ||
| "qs": "^6.14.0" | ||
| "qs": "^6.14.1" | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.