Closed Bug 1555609 Opened 5 years ago Closed 2 years ago

text/plain URL Spoof via data scheme

Categories

(Core :: DOM: Security, defect, P3)

67 Branch
Other
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: chromium.khalil, Unassigned, NeedInfo)

References

(Depends on 1 open bug, Regression)

Details

(Keywords: csectype-spoof, regression, sec-low, Whiteboard: [domsecurity-backlog1])

Attachments

(2 files)

Attached file testcase.html
  1. Lunch the test case
  2. Click on the link
  3. Observe

Khalil: What do you think should be done differently here, and why?

Christoph: AFAICT this is a result of bug 1415612.

Flags: needinfo?(ckerschb)
Flags: needinfo?(chromium.khalil)

iiuc this is limited to plain text spoofing which doesn't seem very effective. Bug 1394554 was rated a sec-low spoof and this isn't even that good so I'm not sure if we even need to keep this hidden.

Group: firefox-core-security → dom-core-security
Status: UNCONFIRMED → NEW
Component: Address Bar → DOM: Security
Ever confirmed: true
Product: Firefox → Core
Regressed by: 1415612
Keywords: regression
Group: dom-core-security
Summary: URL Spoof via data scheme → text/plain URL Spoof via data scheme

The content-type is "//www.facebook.com" followed by tons of spaces. Why are we interpreting that as "text/plain"? maybe we should fall back to "unknown == binary" instead. What breaks if we do that?

Flags: needinfo?(annevk)

(In reply to :Gijs (he/him) from comment #2)

Christoph: AFAICT this is a result of bug 1415612.

Right, plain text spoofing doesn't seem like a high priority fix to me. Let's wait what Anne replies, but most likely we will just have to put that in the backlog.

Flags: needinfo?(ckerschb)

There's a couple of things here:

  1. data://facebook followed by a space/ does not parse as a URL per the URL Standard (and indeed fails to parse in Safari). (Not sure what is happening in Chrome; perhaps top-level data: URL navigations are disallowed?)
  2. I think we could have better UX for different URL schemes. E.g., we could only display the scheme here and also, we could (finally) stop displaying https:// and the path normally, so users would expect to only see the domain when the address bar is not focused.
  3. The default MIME type for data URLs is text/plain as per https://fetch.spec.whatwg.org/#data-urls and I don't think we should focus on changing that as it's been the default ever since they were added.
Depends on: url
Flags: needinfo?(annevk)

#1 would be a change in networking, #2 would be a front-end change. #2 also seems like a large project to ask of a team with a lot of other UX concerns, for practically no improvement for 99.99% of the legitimate web experience.

#1 seems like the best way forward.

Jonas, can you please take a look at this one? I think we should fix #1 from comment 6 to make sure our data: URI phishing filter is not bypassed.

Dragana, can you guide us to the right code where data: URI parsing is happening?

Flags: needinfo?(jallmann)
Flags: needinfo?(dd.mozilla)

(In reply to Christoph Kerschbaumer [:ckerschb] from comment #8)

Dragana, can you guide us to the right code where data: URI parsing is happening?

https://searchfox.org/mozilla-central/source/netwerk/protocol/data/nsDataHandler.cpp#53 etc.

Assignee: nobody → jallmann
Status: NEW → ASSIGNED
Flags: needinfo?(jallmann)
Priority: -- → P2
Whiteboard: [domsecurity-active]
Flags: needinfo?(dd.mozilla)
Has Regression Range: --- → yes

The bug assignee didn't login in Bugzilla in the last 7 months.
:ckerschb, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: jonas.allmann → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(ckerschb)
Flags: needinfo?(ckerschb)
Priority: P2 → P3
Whiteboard: [domsecurity-active] → [domsecurity-backlog1]

This doesn't seem to be a problem any more

  1. primarily it was fixed in bug 1627944 where the behavior in regressing bug 1415612 was changed to only allow PDF and JSON, not text/plain
  2. if you paste the URL to open it all the former spoofing blanks are now displayed as "%20" which ruins the spoof attempt
Status: NEW → RESOLVED
Closed: 2 years ago
Depends on: 1627944
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: