MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.8k stars 4.81k forks source link

[Bug]: MM breaks with the error `String provided to stringToBigNumber is not a hexadecimal or decimal string` #23346

Open seaona opened 5 months ago

seaona commented 5 months ago

Describe the bug

Problem: whenever triggering a transaction from a dapp, if the maxFeePerGas or the maxPriorityFeePerGas have an invalid value type (ie string), MM breaks.

Expected behavior

Handle invalid gas params coming from a dapp

Screenshots/Recordings

Screenshot from 2024-03-06 15-26-20

https://github.com/MetaMask/metamask-extension/assets/54408225/1fde043f-5ff6-4ed7-88b1-c8a192d4aa60

Steps to reproduce

  1. Go to the test dapp - this version https://github.com/MetaMask/test-dapp/pull/295
  2. Trigger invalid max fee per gas
  3. See MM breaks with the error

Error messages or log output

No response

Version

11.10.0 but possibly earlier

Build type

None

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

Severity

No response

matthewwalsh0 commented 2 months ago

The value property should be validated to be a valid number or hex string within the TransactionController, hence the assignment to the transactions team.

digiwand commented 2 months ago

screenshots of states with 0xinvalid maxFeePerGas CleanShot 2024-06-21 at 20 59 22@2x CleanShot 2024-06-21 at 21 02 01@2x CleanShot 2024-06-21 at 21 07 13@2x

sleepytanya commented 4 days ago

https://github.com/MetaMask/metamask-extension/issues/26547 duplicate

Issues is present in v11.16.16 and v.12.0.5