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

New design for phishing warning page #52

Merged

Conversation

aleksandar-mihajlovic
Copy link
Contributor

@aleksandar-mihajlovic aleksandar-mihajlovic commented Jan 27, 2023

Explanation

Added new design for phishing warning page according to figma design.

  • Fixes #16602

Screenshots/Screencaps

Before

Screenshot 2023-01-26 at 16 01 52

After

phishingPageNew

Manual Testing Steps

Production testing:

  1. Go to one of the links: primalfrens.club, geishateahouse.io, cryptocity.fun
  2. Phishing warning page is displayed
  3. All links are working
  4. Advisory provided by is written based on the source of the detection repo (in link there is info if the Metamask or Phishfort is detection repo)
  5. When back to safety is clicked, tab is closed

Local testing:

  1. static/ folder
  2. Double click on index.html
  3. Phishing warning page is displayed
  4. All links are working expect continue to the site, because production app is needed for that
  5. Advisory provided by is written based on the source of the detection repo (in link there is info if the Metamask or Phishfort is detection repo)
  6. When back to safety is clicked, tab is closed

@aleksandar-mihajlovic aleksandar-mihajlovic requested a review from a team as a code owner January 27, 2023 12:14
@aleksandar-mihajlovic aleksandar-mihajlovic marked this pull request as draft January 27, 2023 12:16
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @aleksandar-mihajlovic, nice work matching the Figma design but I think it breaks some of the MetaMask design system conventions that I think should be resolved before this get's merged.

Hey @holantonela, I've left some comments in the Figma file https://www.figma.com/file/MKJnCnI8Xi2EVcRCNAHwOu?node-id=4:49#355806441

static/index.css Outdated Show resolved Hide resolved
static/index.css Outdated Show resolved Hide resolved
static/index.css Outdated Show resolved Hide resolved
@dzfjz
Copy link

dzfjz commented Jan 30, 2023

Verified by QA

@holantonela
Copy link

@georgewrmarshall commented in the figma. Someone introduced that change, but i bet it was a click error. Please, @aleksandar-mihajlovic lets remove the border and the shadow of the title. Thank you!

@aleksandar-mihajlovic aleksandar-mihajlovic marked this pull request as ready for review January 30, 2023 14:10
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Have made one more suggestion. Thanks for your patience @aleksandar-mihajlovic 🙏

static/index.css Outdated Show resolved Hide resolved
</p>
</br>
<p>Advisory provided by Ethereum Phishing Detector, CryptoScamDB, and PhishFort.</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list should be dynamic. We should expose ONLY the sources who are flagging the current URL @aleksandar-mihajlovic @dzfjz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, as I understand, these websites are not scam websites, they are websites that give users info about how to avoid phishing, so they don't need to be listed dynamically. Am I wrong?
And about source that is scam website, the link will be shown in this sentence:
Potential threats on {someWebsite} include:
but i cannot demo it, because i cannot build the project and connect with extension to test it out, but website link will be there once it goes to production.
@holantonela

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To do so, we need to add a query string in the PhishingController to say which list flagged it. cc @409H

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that I understand what I need to do here, because i am not sure what i am doing wrong, if you could explain it to me

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the point 2 in the Acceptance Criteria

  1. Users can read the attribution to who flagged the domain, probably passed to that page with a query string.

MetaMask/metamask-extension#16602

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@409H I currently implemented logic to detect through current query string, I would say that I found a decent solution for now, but in future when other detect repo's are added, this logic should be updated too, if that is okay?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@409H thanks for linking that, I had failed to consider this requirement when reviewing a cost-saving change to how we poll for the phishing list. Unfortunately this information will no longer be available after that change because we're now combining all lists into one to save on network bandwidth.

Still, we can fulfill this requirement without that data by checking on-demand after a user chooses to dispute a block. Tomorrow I will create a separate issue detailing how this needs to change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aleksandar-mihajlovic My apologies, I hadn't looked closely at this PR when I left my first comment.

I don't think we need the onload function you added for this, because that same logic is already handled by index.ts. It was implemented here: #23. We pass in a custom dispute URL if a site is blocked by Phishfort, otherwise we default to ours. As long as that newIssueUrl continues to be set dynamically on this link, no change to this behavior is needed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gudahtt Okay, i removed that part of the code for linking on the onload function, and returned to the old state like you mentioned, is it okay now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aleksandar-mihajlovic , yes this thread looks resolved now

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. There maybe one more update needed to the button that is being resolved in the Figma file

static/index.html Outdated Show resolved Hide resolved
static/index.html Outdated Show resolved Hide resolved
Copy link
Contributor

@NicholasEllul NicholasEllul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page looks fantastic! Glad to see it being implemented

static/index.html Outdated Show resolved Hide resolved
@aleksandar-mihajlovic
Copy link
Contributor Author

@georgewrmarshall can you check the attached gif, is the button okay now? I used the Button Secondary as mentioned in Figma.

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I've created another PR with some more CSS suggestions #55 that you can review and merge into this PR if you think they are acceptable.

@aleksandar-mihajlovic
Copy link
Contributor Author

I have added the CSS code that you suggested @georgewrmarshall if you can check it out.
I have added logic for setting dynamically text and link also, for phishing detection repo that detected phishing website, if you can check it out @holantonela.

weizman
weizman previously requested changes Feb 6, 2023
Copy link
Member

@weizman weizman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor security concern

safety. As always, your transactions are your own responsibility. <span id="redirect-warning-message">If
you wish to interact with any domain on our warning list, you can do
so by <a id="unsafe-continue">continuing at your own risk</a>.</span>
MetaMask flagged the site you're trying to visit as potentially deceptive. Attackers may trick you into doing something dangerous. <a id="csdbLink" href='' onclick="window.open('https://cryptoscamdb.org/search')">Learn more</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this call unsafely allows reverse tab nabbing attacks (read more here) - please fix by adding attribute rel="noopener"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, why use onclick and open when you have the default behaviour of an anchor element?

<a id="csdbLink" rel="noopener" href='https://cryptoscamdb.org/search' target='_blank'">Learn more</a>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay no problem, if it is making security problems, i will changed it right now, you can look at it, if it is okay. @weizman

@AlexHerman1
Copy link

can we make sure that whatever ends up going to prod, we make the attribution prominent and point them towards the correct contributor to raise an issue?

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Going to approve for visual and design system requirements. Nice work! 💯 Please don't merge until all reviewers have approved 🙏

@holantonela
Copy link

can we make sure that whatever ends up going to prod, we make the attribution prominent and point them towards the correct contributor to raise an issue?

Yes @AlexHerman1, we discussed it here

src/index.test.ts Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
@@ -11,6 +11,17 @@
document.getElementById('antiClickjack').innerHTML =
'#content__framed-body { display: none !important; }';
}

window.onload = function() {
document.getElementById("suspect-link").innerText = document.referrer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Could you move this code to the start function in src/index.ts? That is where all of our other "page initialization" code is.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I can address the remaining two nits in a follow-up PR.

@Gudahtt Gudahtt dismissed weizman’s stale review February 15, 2023 20:39

Requested change has been made

@Gudahtt Gudahtt merged commit f365563 into MetaMask:main Feb 15, 2023
Gudahtt added a commit that referenced this pull request Feb 15, 2023
This test was recently removed in #52 due to a change on that PR that
was since undone. It is still relevant, so it has been restored.
@Gudahtt Gudahtt mentioned this pull request Feb 15, 2023
Gudahtt added a commit that referenced this pull request Feb 15, 2023
This test was recently removed in #52 due to a change on that PR that
was since undone. It is still relevant, so it has been restored.
@Gudahtt Gudahtt mentioned this pull request Feb 17, 2023
Gudahtt added a commit that referenced this pull request Feb 20, 2023
The "Open in new tab" link that we show on the warning page when it's
rendered in an iframe was accidentally removed in #52. We need to
preserve this button so that users can better understand why their
iframe'd page is blocked, and so they can dispute or bypass the block
if necessary.
Gudahtt added a commit that referenced this pull request Feb 20, 2023
The "Open in new tab" link that we show on the warning page when it's
rendered in an iframe was accidentally removed in #52. We need to
preserve this button so that users can better understand why their
iframe'd page is blocked, and so they can dispute or bypass the block
if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants