Release v4.9.9#956
Merged
Merged
Conversation
fastjson 1.x parses the "@type" hint even when the target is a JSONObject, and filters it with a deny-list of known gadget classes. wallet-cli feeds untrusted remote payloads into JSON.parseObject (GasFreeApi, MultiSignService, MultiTxWebSocketClient) and never relies on "@type" itself, so force safe mode in Client's static initializer to reject the hint outright. Both the REPL and the standard CLI funnel through Client.main / runMain, so one static block covers both. Defense in depth rather than a patch for a live vulnerability: no published advisory affects 1.2.83. This matches the default fastjson2 ships with. Transaction rendering was the compatibility risk, since a Transaction carries its contract in a protobuf Any. TRON's own JsonFormat prints type_url rather than "@type", guarded by TransactionJsonSafeModeTest.
security(java): enable fastjson safe mode
matrix-agent116
approved these changes
Jul 22, 2026
zerodevblock-cyber
approved these changes
Jul 22, 2026
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.
Bug Fixes
Change
@typehint inJSON.parseObject/parseArrayeven when the declared target is aJSONObject, which is the entry point for autoType gadget chains. wallet-cli feeds remote HTTP and WebSocket payloads (GasFree, multi-sign) into those calls and never relies on@typeitself, so safe mode now rejects the hint outright and removes the remote-code-execution surface. Regression tests cover both the global parser configuration and transaction JSON parsing. (#955)