Skip to content

Implementation of Structural Validation Patches for RNS Deserialization Flaws#60

Open
mausamrijall wants to merge 3 commits intogoogle:masterfrom
mausamrijall:fix-des-vulern-v2
Open

Implementation of Structural Validation Patches for RNS Deserialization Flaws#60
mausamrijall wants to merge 3 commits intogoogle:masterfrom
mausamrijall:fix-des-vulern-v2

Conversation

@mausamrijall
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant