Add an array filter to our serialize/deserialize methods and narrow down previous filter#849
Merged
b4sjoo merged 4 commits intoopensearch-project:2.xfrom Apr 17, 2023
Merged
Conversation
…own previous filter Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## 2.x #849 +/- ##
=========================================
Coverage 84.81% 84.82%
Complexity 1628 1628
=========================================
Files 135 135
Lines 6079 6083 +4
Branches 596 596
=========================================
+ Hits 5156 5160 +4
Misses 666 666
Partials 257 257
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
ylwu-amzn
reviewed
Apr 17, 2023
ml-algorithms/src/main/java/org/opensearch/ml/engine/utils/ModelSerDeSer.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
dhrubo-os
approved these changes
Apr 17, 2023
Contributor
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-849-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0997d6cbc247b705c340e31480e381513d3a8691
# Push it to GitHub
git push --set-upstream origin backport/backport-849-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.xThen, create a pull request where the |
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Apr 17, 2023
…own previous filter (#849) * Add an array filter to our serialize/deserialize methods and narrow down previous filter Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Further narrowing down accept list Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Keep narrowing down accept list Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Add test for deserialization methods in all built-in models Signed-off-by: Sicheng Song <sicheng.song@outlook.com> --------- Signed-off-by: Sicheng Song <sicheng.song@outlook.com> (cherry picked from commit 0997d6c)
b4sjoo
added a commit
that referenced
this pull request
Apr 17, 2023
…own previous filter (#849) (#857) * Add an array filter to our serialize/deserialize methods and narrow down previous filter Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Further narrowing down accept list Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Keep narrowing down accept list Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Add test for deserialization methods in all built-in models Signed-off-by: Sicheng Song <sicheng.song@outlook.com> --------- Signed-off-by: Sicheng Song <sicheng.song@outlook.com> (cherry picked from commit 0997d6c) Co-authored-by: Sicheng Song <sicheng.song@outlook.com>
rbhavna
pushed a commit
to rbhavna/ml-commons
that referenced
this pull request
Jun 16, 2023
…own previous filter (opensearch-project#849) * Add an array filter to our serialize/deserialize methods and narrow down previous filter Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Further narrowing down accept list Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Keep narrowing down accept list Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Add test for deserialization methods in all built-in models Signed-off-by: Sicheng Song <sicheng.song@outlook.com> --------- Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
rbhavna
pushed a commit
to rbhavna/ml-commons
that referenced
this pull request
Jun 16, 2023
…own previous filter (opensearch-project#849) * Add an array filter to our serialize/deserialize methods and narrow down previous filter Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Further narrowing down accept list Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Keep narrowing down accept list Signed-off-by: Sicheng Song <sicheng.song@outlook.com> * Add test for deserialization methods in all built-in models Signed-off-by: Sicheng Song <sicheng.song@outlook.com> --------- Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
Merged
5 tasks
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.
Description
Previous we did not add filter to the depth and byte array length to our deserialization method, which can cause a denial of service attack via very long arrays or nested objects. Meanwhile we have an allowlist that is too general so malicious files could potentially bypass. Now we narrow down the allowlist, add a reject list, and also add a depth and length filter. In long term we will try to change this byte stream deserialization method into json or protocol buffer.
Issues Resolved
This is a short-term fix in regards to a security ticket.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.