Implementation of Structural Validation Patches for RNS Deserialization Flaws#60
Open
mausamrijall wants to merge 3 commits intogoogle:masterfrom
Open
Implementation of Structural Validation Patches for RNS Deserialization Flaws#60mausamrijall wants to merge 3 commits intogoogle:masterfrom
mausamrijall wants to merge 3 commits intogoogle:masterfrom
Conversation
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.
I am providing a formal update regarding the previously reported deserialization vulnerabilities in the shell-encryption library.
Although the initial report was marked as invalid, further technical analysis confirms that the library lacks essential structural invariant checks during the deserialization of RNS objects. This allows malformed Protobuf inputs to be accepted, leading to deterministic Segmentation Faults and Undefined Behavior in core cryptographic operations (e.g., LogN(), key-switching, and coefficient allocation).
Proposed Fixes & Mitigation:
I have submitted a formal Pull Request to the google/shell-encryption repository (PR #[Insert Your PR Number Here]) which implements the following defensive measures:
RnsRlweCiphertext: Enforces non-empty component validation to prevent null-pointer dereferences in metadata accessors.
RnsGaloisKey: Validates key_bs dimensions against gadget parameters to prevent out-of-bounds memory access during key-switching.
RnsPolynomial: Implements range checking for log_n to prevent undefined behavior from unsafe bit-shift operations.
Verification:
The patches have been verified using the included Python PoC (poc_rns_deserialize_findings.py), which now confirms that all three attack vectors are gracefully rejected with absl::InvalidArgumentError instead of causing process crashes.
I have signed the Google CLA and request a re-evaluation of the security impact based on these provided engineering mitigations