using long url address in permission prompt truncated lead to spoof
Categories
(Firefox :: Site Permissions, defect, P1)
Tracking
()
People
(Reporter: sas.kunz, Assigned: emz)
References
(Regression)
Details
(4 keywords, Whiteboard: [client-bounty-form] [adv-main132+] [adv-esr128.4+])
Attachments
(7 files)
|
188.92 KB,
image/png
|
Details | |
|
2.58 MB,
video/mp4
|
Details | |
|
67.43 KB,
image/png
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
|
154 bytes,
text/plain
|
Details |
when using long url address, url in permission prompt is truncated leading to spoof
steps to reproduce
- open https://xxxxxxxxxxxxxxxxxxx.login.secures.documents.drives.google.com.aogarantiza.com/chromium/pepc-bounds.html
- open console do :
navigator.mediaDevices.getUserMedia(
{audio: true, video: true}).then() - the url shown in permission prompt: https://xxxxxxxxxxxxxxxxxxx.login.secures.documents.drives.google.com not https://xxxxxxxxxxxxxxxxxxx.login.secures.documents.drives.google.com.aogarantiza.com
OS: windows 10
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
The PopupNotification used to resize properly to accommodate the long URL. This is a regression.
I ran mozgression on it:
8:57.59 INFO: Narrowed nightly regression window from [2022-10-17, 2022-10-19] (2 days) to [2022-10-17, 2022-10-18] (1 days) (~0 steps left)
8:57.59 INFO: Got as far as we can go bisecting nightlies...
8:57.59 INFO: Last good revision: ac1330b68d3e7b231a177cfa1ac52e1b2199bb84 (2022-10-17)
8:57.59 INFO: First bad revision: b6e04e02b4f8532eac41194d203e72d91dbfc2ff (2022-10-18)
8:57.59 INFO: Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ac1330b68d3e7b231a177cfa1ac52e1b2199bb84&tochange=b6e04e02b4f8532eac41194d203e72d91dbfc2ff
Not sure yet which is the regressing bug.
| Assignee | ||
Comment 4•1 year ago
•
|
||
This is a bit of a long-shot: Emilio, could this be related to Bug 1790616?
| Assignee | ||
Updated•1 year ago
|
Comment 5•1 year ago
|
||
That seems likely, before that, rules like this one weren't really honored. If you change that to min-content then it works as you expect.
We could:
- Add a
min-width: min-contentto that rule. - Remove that rule.
- Allow the domain to break by using
word-break: anywhereor so? - Something else?
| Assignee | ||
Comment 6•1 year ago
|
||
Thanks! Let's mark it as a regression for now.
I like the idea of word-break: anywhere but going back to the original behavior by updating the width may be safer here.
Comment 7•1 year ago
|
||
Set release status flags based on info from the regressing bug 1790616
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 8•1 year ago
|
||
The ideal solution here would be to add an ellipsis in the right spot so that the site (eTLD+1) is still shown. We could also detect the "overflow" and switch to only showing site in that case. I'm wondering if we have existing helpers specifically for URIs for this that are not just cropping somewhere in the center.
As a stop-gap fix I suggest to add word-break: break-all;. However, we can't add it to the entire body because that would mean we would break anywhere for the entire description text which doesn't look good and difficult to read.
Targeting just the host portion turned out to be trickier than I thought. The l10n string uses a %S placeholder for the host which then gets replaced by < >. This is handed to PopupNotifications#show which parses it and eventually sets the name attribute on the custom element <popupnotification>. This name attribute is then mapped to the DOM using a quite obscure selector.
I'm working on a patch which makes the selector a bit clearer and targets only the "name" field, making it wrap anywhere. I need to double check that we really only use this field for hosts and not insert other text which should wrap properly.
Setting custom style just for the host portion of the description would be a lot easier if these prompts used Fluent. Fluent allows developers to add HTML tags as part of the localization string. This is where we could add e.g. a class name to target. However, I consider migrating all site permission prompts to Fluent out of scope for this bug.
While looking into this I've noticed that PopupNotifications supports displaying the host via the displayURI option. Permission prompts don't seem to use that (anymore?). Probably because we now show the host inline as part of the description text. The displayURI implementation uses crop=center which will add an ellipsis in the middle. Most of the time that resolves this problem. There may still be cases where the site (eTLD+1) part is so long that it will hide parts of it too.
Updated•1 year ago
|
Comment 9•1 year ago
|
||
Set release status flags based on info from the regressing bug 1790616
| Assignee | ||
Comment 10•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 11•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D224303
Updated•1 year ago
|
Comment 12•1 year ago
|
||
beta Uplift Approval Request
- User impact if declined: Spoofing of hostname in permission prompts.
- Code covered by automated testing: no
- Fix verified in Nightly: no
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: See comment 0
- Risk associated with taking this patch: low
- Explanation of risk level: Only a styling change. There is a low risk for a cosmetic issue where we wrap content of PopupNotifications weirdly.
- String changes made/needed: none
- Is Android affected?: no
Comment 13•1 year ago
|
||
| Assignee | ||
Comment 14•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D224303
Updated•1 year ago
|
Comment 15•1 year ago
|
||
esr128 Uplift Approval Request
- User impact if declined: Spoofing of hostname in permission prompts.
- Code covered by automated testing: no
- Fix verified in Nightly: no
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: See comment 0
- Risk associated with taking this patch: low
- Explanation of risk level: Only a styling change. There is a low risk for a cosmetic issue where we wrap content of PopupNotifications weirdly.
- String changes made/needed: none
- Is Android affected?: no
Comment 16•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 17•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Comment 18•1 year ago
|
||
Reproduced this issue on an affected nightly build, following the STR from Comment 0.
Verified as fixed on latest Nightly 133.0a1 (2024-10-03) and latest Beta 132.0b3 (treeherder build - 20241003135730) on Win 10, Win 11, macOS 11 and Ubuntu 22.04.
Updated•1 year ago
|
| Comment hidden (offtopic) |
| Comment hidden (offtopic) |
| Assignee | ||
Comment 22•1 year ago
|
||
Rebased https://phabricator.services.mozilla.com/D224349
Though I didn't run into any merge conflicts locally. Might have auto merged properly.
Updated•1 year ago
|
Comment 23•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 24•1 year ago
|
||
Verified as fixed on Firefox 128.4.0esr (20241021193311) on Win 10, Win 11, macOS 11 and Ubuntu 22.04.
Comment 25•1 year ago
|
||
Updated•1 year ago
|
Updated•6 months ago
|
Description
•