Closed Bug 1626265 Opened 5 years ago Closed 5 years ago

Don't hide the status panel (status bar) while a link's context menu is open

Categories

(Firefox :: Tabbed Browser, enhancement, P3)

enhancement
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 76
Iteration:
76.2 - Mar 23 - Apr 5
Tracking Status
firefox76 --- fixed

People

(Reporter: anasfalhi4, Assigned: dao)

References

Details

Attachments

(3 files)

Attached video firefox vs chrome's behavior (deleted) —

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0

Steps to reproduce:

i created an HTML file that contains a hyperlink tag which changes it's value when the mouse right click is triggered to a phishing website.

index.html:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test</title>
</head>
<body style="background-color: black">
<a style="color:white;text-decoration: none;" href="https://www.facebook.com" oncontextmenu="this.href='https://www.evilwebsite.com'"><h1>Facebook<h1></a>
</body>
</html>

Actual results:

Changing the href attribute value right after the right-click menu is triggered
without any way for the "victim" to notice that.

*please see attached video

Expected results:

the same bug was tested on chrome but in chrome seems to handle it well
because the left-bottom bar in the corner remains visible even after the right click while in firefox it disappears.

*please see attached video

It seems strictly better not to hide the status bar when the context menu shows, so that's a valid bug. It should also update if the link changes, for which we have bug 1438660 already on file.

However, in terms of the security implications, we have oodles of bugs on this type of thing on file (see also bug 229050), and the phishing case for the context menu isn't really very compelling given you can do it on mousedown for most "normal" link clicks, undetected, and you could probably cobble something together with the context menu event (or just prevent it) by using a timeout or doing more detailed mouse tracking, to change the link only right before you actually use one of the context menu items.

In your video, I don't see the status tooltip at all in the Firefox case, so I'm not sure how this relates to comment #0 - but the hiding of the tooltip will be due to mouse movement (away from the link, in this case, onto the context menu), not due to the fact that the context menu opens per se.

Group: firefox-core-security
Status: UNCONFIRMED → NEW
Component: Untriaged → Tabbed Browser
Ever confirmed: true
Summary: Changing the href attribute after right-click which can be used for phishing → Don't hide the status bar / tooltip while the context menu is open on a link

In the case of mousedown there is a chance that the user may notice what's going on, given this code:

<a href="https://www.twitter.com" onmousedown="this.href='https://www.ohjeez.com'">TWITTER</a>

if you hold down the left mouse button you will see that the status bar shows the actual domain that you are going to, even tho the action is fast but the hidden URL is still shown so there is a chance that the user may see it, unlike contextmenu there is no way a user can notice the attack no matter how fast you perform the action.
another thing that i am sure i am not the only one who do it is that sometimes i like to drag the hyperlink to the tabs bar to avoid leaving the current page sometimes i prefer it over CTRL+LEFT MOUSE/ Command+LEFT MOUSE and while dragging it to the tabs bar obviously it's shown in the status bar.

In the video you can actually see the status bar for like 3 seconds when hovering the hyperlink but it disappears right after the context menu opens and that's the problem, the status bar should remain visible just like in chrome's case

you are right about the status bar not showing i apologize seems like there is a problem with the uploaded video i'll try to re-upload it

Attached video firefox (deleted) —
Flags: sec-bounty-
Type: defect → enhancement
Priority: -- → P3
Summary: Don't hide the status bar / tooltip while the context menu is open on a link → Don't hide the status panel (status bar) while a link's context menu is open
Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Iteration: --- → 76.2 - Mar 23 - Apr 5
Points: --- → 2
Pushed by dgottwald@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/36e838e2cdad Don't hide the status panel while a link's context menu is open. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: