Closed Bug 1346059 Opened 7 years ago Closed 7 years ago

browser.tabs.create can still open privileged urls

Categories

(WebExtensions :: General, defect)

55 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: qab, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce:

According to 'https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/create'

"For security reasons, in Firefox, this may not be a privileged URL. "

Seems like we can trick it into opening about:newtab if we pass 'undefined' to the URL (check out attached poc) 

1. Go to 'about:debugging'
2. Click 'Load Temporary Add-on' 
3. Select the attached addon (after extracting to folder)




Actual results:

'about:newtab' opened


Expected results:

'about:blank' should have opened
Just to further prove this is unintended, if we set url to go to 'about:newtab' it will result in the following error:

[JavaScript Error: "Error: Illegal URL: about:newtab"]
Kris, what can we do about this? I'm not sure about the background to the security restrictions here, but I also imagine that we want add-ons to be able to effectively say "open a new tab" and then have that have the same behaviour as opening a new tab normally does.
Group: firefox-core-security → toolkit-core-security
Component: Untriaged → WebExtensions: General
Flags: needinfo?(kmaglione+bmo)
Product: Firefox → Toolkit
This is the intended behavior. It's not possible to explicitly open URLs like about:newtab, but new tabs created without a URL open with the default new tab page.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(kmaglione+bmo)
Resolution: --- → INVALID
(In reply to Kris Maglione [:kmag] from comment #3)
> This is the intended behavior. It's not possible to explicitly open URLs
> like about:newtab, but new tabs created without a URL open with the default
> new tab page.

So we can open this bug up (unmark sec-sensitive), right?
Flags: needinfo?(kmaglione+bmo)
Yes
Flags: needinfo?(kmaglione+bmo)
Group: toolkit-core-security
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: