Cyber Risks · Trail of Bits Blog

Finding mispriced opcodes with fuzzing

Summary: Trail of Bits built a fuzzing harness for Fuel Labs that executes scripts calling internal contracts, replacing libFuzzer with a LibAFL shim to raise throughput from roughly 50 to about 1,000 executions per second on an eight-core machine. The harness found that the opcodes MCLI, SCWQ, K256, SWWQ, and SRWQ may be mispriced, with the SCWQ, SWWQ, and K256 results expected because fuzzing had already surfaced problematic behavior addressed in FuelLabs/fuel-vm#537.

Key Takeaway: An opcode that charges too little gas is a direct path to resource exhaustion on a smart contract platform, and the fuzzer found these by preferring short inputs with long execution times. The corpus that produced this result represents thousands of CPU hours of refinement, and Trail of Bits notes an attacker could use the same corpus to quickly identify vulnerable code if it is kept in a public repository rather than access-controlled storage.

Read the original at Trail of Bits Blog ↗