Fix Insecure Deserialization Vulnerability in toObject Method#1
Open
th555555 wants to merge 2 commits intorisesoft-y9:mainfrom
Open
Fix Insecure Deserialization Vulnerability in toObject Method#1th555555 wants to merge 2 commits intorisesoft-y9:mainfrom
th555555 wants to merge 2 commits intorisesoft-y9:mainfrom
Conversation
Summary This PR addresses a critical security vulnerability in the toObject method which performs unrestricted deserialization of objects, potentially allowing remote code execution if the serialized data comes from untrusted sources. Description The current implementation uses standard ObjectInputStream without any class validation, which is vulnerable to deserialization attacks. This change implements proper validation by using Apache Commons IO's ValidatingObjectInputStream and explicitly whitelisting allowed classes.
Summary This PR addresses a security vulnerability in the model export feature where filenames are not properly encoded in HTTP headers, potentially allowing for HTTP header injection attacks. Description The current implementation adds the filename directly to the Content-Disposition header without encoding, which can lead to security issues if model keys contain special characters. This change adds proper URL encoding to the filename to prevent HTTP header injection and ensure correct handling of special characters. the code is vulnerable because: It doesn't encode the filename in the Content-Disposition HTTP header This could lead to HTTP header injection if model.getKey() contains characters like CR, LF, or other special characters It might also cause filename rendering issues with international characters or spaces The input is user-controlled (via modelId parameter) and its output is reflected in HTTP headers References hs-web/hsweb-framework@b72a227 https://nvd.nist.gov/vuln/detail/CVE-2023-29285
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.
Summary
This PR addresses a critical security vulnerability in the toObject method which performs unrestricted deserialization of objects, potentially allowing remote code execution if the serialized data comes from untrusted sources.
Description
The current implementation uses standard ObjectInputStream without any class validation, which is vulnerable to deserialization attacks. This change implements proper validation by using Apache Commons IO's ValidatingObjectInputStream and explicitly whitelisting allowed classes.
References
apache/hadoop@5e2f433
https://nvd.nist.gov/vuln/detail/CVE-2022-25168