You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SWWQ (State write sequential 32 byte slots) instruction consumes constant gas, but its execution time depends linearly on the parameter D. The following figure shows the contract code which contains the expensive instructions.
The severity of this issue is limited by the fact that SWWQ checks the value of the parameter D, which is limited by the memory size. The contract above can be invoked as described in figure 29.2.
Similarly to #565, a loop bound by the parameter D causes a long execution time. The following figure shows the loop.
Figure 30.2: Loop based on the parameter D of SWWQ. (fuel-vm/fuel-vm/src/storage/memory.rs#379–414)
An attacker deploys a contract that includes a malicious SWWQ instruction. With little gas an attacker can put a significant amount of stress on the network.
Recommendations
Short term, charge gas which dynamically depends on the parameter D.
Long term, deploy the fuzzer from the fuzzing appendix (see appendix E). By using a
reasonably low timeout of 100ms to 1s it is possible to catch bugs like this.
The text was updated successfully, but these errors were encountered:
Description
The SWWQ (State write sequential 32 byte slots) instruction consumes constant gas, but its execution time depends linearly on the parameter D. The following figure shows the contract code which contains the expensive instructions.
Figure 30.1: Expensive instruction.
The severity of this issue is limited by the fact that SWWQ checks the value of the parameter D, which is limited by the memory size. The contract above can be invoked as described in figure 29.2.
Similarly to #565, a loop bound by the parameter D causes a long execution time. The following figure shows the loop.
Figure 30.2: Loop based on the parameter D of SWWQ. (fuel-vm/fuel-vm/src/storage/memory.rs#379–414)
Exploit Scenario
An attacker deploys a contract that includes a malicious SWWQ instruction. With little gas an attacker can put a significant amount of stress on the network.
Recommendations
Short term, charge gas which dynamically depends on the parameter D.
Long term, deploy the fuzzer from the fuzzing appendix (see appendix E). By using a
reasonably low timeout of 100ms to 1s it is possible to catch bugs like this.
The text was updated successfully, but these errors were encountered: