Skip to content

Fix string encoding in network_c2_etherhiding.py#594

Closed
kevross33 wants to merge 1 commit into
CAPESandbox:masterfrom
kevross33:patch-401152
Closed

Fix string encoding in network_c2_etherhiding.py#594
kevross33 wants to merge 1 commit into
CAPESandbox:masterfrom
kevross33:patch-401152

Conversation

@kevross33

Copy link
Copy Markdown
Contributor

No description provided.

@kevross33 kevross33 closed this Jul 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request removes the double quotes from the Ethereum method name checks in the network_c2_etherhiding signature. However, the feedback points out that this fix is incomplete because the outer check still strictly requires double quotes for "jsonrpc" and "method", which are likely subject to the same encoding variations. It is recommended to update the outer check as well and simplify the method checks using any() as suggested.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +65 to +67
"eth_call" in buffer_lower
or "eth_gettransactionbyhash" in buffer_lower
or "eth_getstorageat" in buffer_lower

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While removing the double quotes from the Ethereum method names (e.g., changing '"eth_call"' to "eth_call") allows matching them when quotes are escaped, single-quoted, or omitted, the outer check on line 63 still strictly requires double quotes:

if '"jsonrpc"' in buffer_lower and '"method"' in buffer_lower:

If the encoding issue affects the quotes around the method names, it is highly likely to also affect the quotes around "jsonrpc" and "method". As a result, this fix is incomplete and the signature will still fail to match in those scenarios.

To fully resolve this, please also update the outer check on line 63 to not require double quotes (e.g., "jsonrpc" in buffer_lower and "method" in buffer_lower).

Additionally, we can simplify the method check using any() for better readability.

Suggested change
"eth_call" in buffer_lower
or "eth_gettransactionbyhash" in buffer_lower
or "eth_getstorageat" in buffer_lower
any(m in buffer_lower for m in ("eth_call", "eth_gettransactionbyhash", "eth_getstorageat"))

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