MetaMask / metamask-extension

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

[Bug]: Navigation between unapproved transactions breaks MM with Cannot read properties of undefined (reading 'length') / Message: Should have a queue. This is likely a bug in React. errors #27913

Open sleepytanya opened 2 days ago

sleepytanya commented 2 days ago

Describe the bug

Navigation between two pending malicious transactions breaks MetaMask with errors:

Cannot read properties of undefined (reading 'length')

and

Message: Should have a queue. This is likely a bug in React

At the moment, functionalities like Malicious ERC20 Approval (BUSD) and Malicious Set Approval for All are not operating as anticipated in both the develop branch and the RC 12.5.0 version on Base and BNB networks.

https://github.com/MetaMask/metamask-extension/issues/27909

https://github.com/MetaMask/metamask-extension/issues/27905

If a user initiates two consecutive transactions where the latter is a Malicious Set Approval for All, attempting to navigate between these transactions in the popup triggers an error. However, in the Expanded view, these transactions appear as unapproved and can be successfully processed or cancelled.

Expected behavior

No errors

Screenshots/Recordings

Screenshot 2024-10-15 at 21 55 07 Screenshot 2024-10-15 at 22 36 52

https://github.com/user-attachments/assets/e061546a-3d62-4108-a2ba-09c90c8b1751

https://github.com/user-attachments/assets/c2920982-a210-4bf1-8079-8377a4467af8

Steps to reproduce

  1. Connect to test dapp
  2. Trigger any transaction, do not confirm
  3. Trigger Malicious Set Approval for All Alternatively, trigger Malicious Set Approval for All first and then any button from PPOM section - this will produce another type of error.

Error messages or log output

No response

Detection stage

On the development branch

Version

12.4.1

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

jpuri commented 1 day ago

Hey @sleepytanya , I also faced this issue at some point, but I am not able to replicate this in latest code:

https://github.com/user-attachments/assets/94ed2b94-aca9-4bb8-9195-edbda4c608be

sleepytanya commented 15 hours ago

@jpuri I'm still seeing it on develop:

https://github.com/user-attachments/assets/cc40e274-faec-42a1-a7a9-72f88776a4cf