Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: PPOM - Malicious transactions triggered from Deeplinks are not flagged #8326

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

segun
Copy link
Contributor

@segun segun commented Jan 18, 2024

Description

When a malicious transaction is triggered from a dapplink, the blockaid banner alert is not shown. This is because the transaction is shown in the confirm screen after evaluation without calling PPOM.

The approach taken here is to add ppom validation to send flow.

Related issues

Fixes: #7543

Manual testing steps

  1. Enable Blockaid in Experimental Settings
  2. Goto https://metamask.github.io/metamask-deeplinks/# and generate a malicious Payment Request, set the recipient to this malicious address: 0x5FbDB2315678afecb367f032d93F642f64180aa3
  3. Open MM Mobile and scan the QR code generated in 1 above
  4. You should not see a Blockaid alert
  5. Press Cancel the confirm screen
  6. Perform a normal send from wallet, enter 0x5FbDB2315678afecb367f032d93F642f64180aa3 as the recipient
  7. On confirm screen, you should not see a Blockaid alert
  8. Checkout this branch, build and run on a physical device
  9. Repeat Steps 2-7
  10. This time Blockaid alert should be shown on the confirm screen in Step 4 and Step 7

Screenshots/Recordings

Before

WhatsApp.Video.2024-01-18.at.09.40.43.mp4

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@segun segun added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-confirmations-secure-ux-PR PR from the confirmations team labels Jan 18, 2024
@segun segun self-assigned this Jan 18, 2024
@segun segun requested a review from a team as a code owner January 18, 2024 08:44
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9825bcf4-6087-4afb-8db5-540831e9d45c
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@segun segun requested a review from jpuri January 23, 2024 11:01
blackdevelopa
blackdevelopa previously approved these changes Jan 24, 2024
Copy link

sonarcloud bot commented Jan 24, 2024

@codecov-commenter
Copy link

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (c6aec14) 40.34% compared to head (fa640f4) 40.34%.
Report is 3 commits behind head on main.

Files Patch % Lines
app/components/Views/SendFlow/Confirm/index.js 50.00% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8326   +/-   ##
=======================================
  Coverage   40.34%   40.34%           
=======================================
  Files        1235     1236    +1     
  Lines       29957    29993   +36     
  Branches     2877     2881    +4     
=======================================
+ Hits        12087    12102   +15     
- Misses      17175    17195   +20     
- Partials      695      696    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@segun segun merged commit 74b3a57 into main Jan 25, 2024
26 checks passed
@segun segun deleted the olu/blockaid-dapplink-fix2 branch January 25, 2024 13:54
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jan 25, 2024
@metamaskbot metamaskbot added the release-7.16.0 Issue or pull request that will be included in release 7.16.0 label Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.16.0 Issue or pull request that will be included in release 7.16.0 team-confirmations-secure-ux-PR PR from the confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: PPOM - Malicious transactions triggered from Deeplinks are not flagged
6 participants