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 decoder for UTXO IDs panics for certain inputs with multibyte characters. The vulnerable code is reachable through the GraphQL API. The following query makes the Fuel node panic. It does not crash the complete node because the Tokio scheduler handles the panic by starting a new thread. The following figure shows the query which causes a panic.
Figure 17.1: GraphQL query which causes a panic in a worker thread.
{
coin(utxoId: "0x00 ") { utxoId } 😎}
The following figure shows the code which slices the input string at a certain byte without taking character boundaries into consideration.
Figure 17.2: Code which panics for certain multibyte inputs. (fuel-vm/fuel-tx/src/transaction/types/utxo_id.rs#104–118)
Rapidly sending GraphQL queries which cause worker threads to crash, might lead to a denial-of-service because starting new threads is resource intensive. Furthermore, Tokiomight run out of worker threads temporarily if they are crashing faster than they can be restarted.
Recommendations
Short term, verify that the input for the UTXO ID parsing contains only single byte characters.
Long term, consider enabling the Clippy rule string_slice.
The text was updated successfully, but these errors were encountered:
Description
The decoder for UTXO IDs panics for certain inputs with multibyte characters. The vulnerable code is reachable through the GraphQL API. The following query makes the Fuel node panic. It does not crash the complete node because the Tokio scheduler handles the panic by starting a new thread. The following figure shows the query which causes a panic.
Figure 17.1: GraphQL query which causes a panic in a worker thread.
The following figure shows the code which slices the input string at a certain byte without taking character boundaries into consideration.
Figure 17.2: Code which panics for certain multibyte inputs. (fuel-vm/fuel-tx/src/transaction/types/utxo_id.rs#104–118)
Exploit Scenario
Rapidly sending GraphQL queries which cause worker threads to crash, might lead to a denial-of-service because starting new threads is resource intensive. Furthermore, Tokiomight run out of worker threads temporarily if they are crashing faster than they can be restarted.
Recommendations
Short term, verify that the input for the UTXO ID parsing contains only single byte characters.
Long term, consider enabling the Clippy rule string_slice.
The text was updated successfully, but these errors were encountered: