Skip to content

security(java): enable fastjson safe mode - #955

Merged
gummy789j merged 2 commits into
release_v4.9.9from
fix/fastjson-rce-vulnerability
Jul 20, 2026
Merged

security(java): enable fastjson safe mode#955
gummy789j merged 2 commits into
release_v4.9.9from
fix/fastjson-rce-vulnerability

Conversation

@gummy789j

Copy link
Copy Markdown
Collaborator

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.

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.
@gummy789j
gummy789j merged commit afc02ed into release_v4.9.9 Jul 20, 2026
@gummy789j gummy789j mentioned this pull request Jul 22, 2026

@albertoblue87-netizen albertoblue87-netizen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protocolo /955

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.

3 participants