fix(crypto): harden cryptographic validation and security#6649
Closed
Federico2014 wants to merge 5 commits intotronprotocol:developfrom
Closed
fix(crypto): harden cryptographic validation and security#6649Federico2014 wants to merge 5 commits intotronprotocol:developfrom
Federico2014 wants to merge 5 commits intotronprotocol:developfrom
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.
What does this PR do?
This PR hardens the security and robustness of cryptographic subsystems in java-tron across five areas:
topicsListfrom shielded TRC20 log APIs – eliminates dead parameter that leaked internal state fromScanShieldedTRC20NotesByIvk/OvkHTTP endpoints and RPC services.Wallet,ZenTransactionBuilder,ShieldedTRC20ParametersBuilder, and related servlets to prevent malformed or malicious inputs from reaching the ZK proof layer.SM2andSM2Signerto enforce deterministic RFC 6979 nonce generation, validate curve points on deserialization, and reject weak or low-order keys.ECKey,Rsv, andSignUtilsto reject out-of-range scalars, invalid recovery IDs, and malformed signature encodings before they reach the native crypto layer.Why are these changes required?
These fixes address a class of signature malleability and input validation vulnerabilities where crafted inputs could bypass cryptographic checks, produce incorrect signatures, or expose internal data through API responses. Hardening these layers reduces the attack surface on both the node and its RPC/HTTP API surface.
This PR has been tested by:
ECKeyTest,SM2KeyTest,ShieldedTRC20BuilderTest,WalletMockTest,ShieldedTransferActuatorTest,RpcApiServicesTest,ArgsTest)Follow up
Consider fuzzing the signature verification path with property-based tests.
Extra details
sprout-verifying.keybinary artifact from the repository root.api.protoupdated to remove deprecatedtopicsListfields from shielded scan responses.