Submitted by gxh191
The TraceTx method in x/evm/keeper/grpc_query.go implements a gRPC query interface that allows simulation and tracing of specific transactions based on provided configurations. This method enables users to perform detailed execution simulations for transactions in a block.
However, a DOS issue arises during the simulation of predecessor transactions.
Within the TraceTx function, predecessor transactions are simulated first, followed by transaction tracing:
https://github.com/code-423n4/2024-11-nibiru/blob/main/x/evm/keeper/grpc_query.go#L547
During the simulation of predecessor transactions, an attacker can exploit the process by providing an excessively large number of transactions in the req.Predecessors parameter. This forces the chain to repeatedly compute transaction results, maliciously consuming resources and leading to a denial of service.
https://github.com/code-423n4/2024-11-nibiru/blob/main/x/evm/keeper/grpc_query.go#L511
An attacker only needs to send an RPC query with an excessively large --predecessors parameter to trigger the DOS:
Similar to the timeout mechanism in TraceEthTxMsg, a timeout restriction can be implemented to mitigate potential abuse:
By adding a similar timeout limitation, the execution of TraceTx can be bound within a reasonable time frame. This reduces the risk of excessive resource consumption caused by intentionally large input parameters or malicious queries.
berndartmueller (judge) decreased severity to Medium
k-yang (Nibiru) acknowledged and commented:
