Let geckodriver forward a "--allow-system-access" argument to Firefox to prevent parent process access by default
Categories
(Testing :: geckodriver, enhancement, P2)
Tracking
(firefox-esr115 wontfix, firefox-esr128 wontfix, firefox137 fixed)
People
(Reporter: jgraham, Assigned: whimboo)
References
Details
(Keywords: sec-want, Whiteboard: [webdriver:m15] [adv-main137-] )
Attachments
(1 file, 1 obsolete file)
Comment 1•9 years ago
|
||
| Assignee | ||
Comment 2•9 years ago
|
||
| Reporter | ||
Comment 3•9 years ago
|
||
| Reporter | ||
Comment 4•9 years ago
|
||
Updated•8 years ago
|
Updated•8 years ago
|
| Assignee | ||
Comment 5•5 years ago
|
||
(In reply to James Graham [:jgraham] from comment #0)
It therefore might make sense to make this a separate opt-in feature. I
think that an environment variable likeMOZ_MARIONETTE_CHROMEmakes sense
since geckodriver users can't set environment variables through capabilities.
Maybe something has changed since then but environment variables can be set via capabilities:
https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions#Env
But these should only affect Firefox but not geckodriver itself, and as such geckodriver can disallow switching into chrome scope. So maybe this might be enough for now?
| Reporter | ||
Comment 6•5 years ago
|
||
Yeah, I think that an enironment variable that applies to geckodriver is enough.
| Reporter | ||
Comment 7•5 years ago
|
||
Usually WebDriver users should not need to run code in Chrome scope. For the few cases
where they do, allow passing a command line flag to GeckoDriver to enable the context
related endpoints.
The approach here just puts a conditional in when sending the message to WebDriver;
if we did more things like this it would be better to have a mechanism to avoid
registering the routes at all.
Updated•5 years ago
|
| Reporter | ||
Comment 8•5 years ago
|
||
My patch is a partial solution here in that it works at the geckodriver level to forbid access to these routes. We could still consider making marionette itself require some setup to allow this kind of access, but this at least helps ensure that it's harder for WebDriver users to escape the sandbox.
| Assignee | ||
Comment 9•5 years ago
|
||
James, are you going to continue work on this patch? If not can you please unassign?
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 10•5 years ago
|
||
James, with bug 1708689 in place for a remote attack I'm worried about a simple chrome context switch by just using Marionette. There is still a vector for attack that we should remove at the basis, and only allow switching to the chrome context when a special command line argument (like --marionette-enable-chrome) or environment variable (MOZ_MARIONETTE_CHROME) is set for Marionette when starting Firefox.
Using a command line argument for Firefox would make it easier for geckodriver to forward its own command line argument.
| Reporter | ||
Comment 11•5 years ago
•
|
||
I think the patch here is in a state where we could just land it. I agree that a followup to require specifying a command line, pref, or environment variable, on the marionette side would be a good idea.
| Assignee | ||
Comment 12•5 years ago
|
||
This patch will actually only make changes to geckodriver but not Marionette. As such I will file a follow-up for the remaining work.
| Assignee | ||
Comment 13•4 years ago
|
||
As discussed in Monday's triage meeting I'll have to check how this change will affect tests for WebExtensions, and how these get run in some CI. I'll try to find some time over the next days.
Updated•3 years ago
|
| Assignee | ||
Comment 14•1 year ago
|
||
We should first settle on a solution for Marionette before we can actually patch geckodriver to restrict chrome context support.
| Assignee | ||
Comment 15•1 year ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #14)
We should first settle on a solution for Marionette before we can actually patch geckodriver to restrict chrome context support.
There is actually a problem with this proposal. If Marionette restricts access first all consumers of geckodriver, that require these extra permissions, will not be able to run their tests anymore with older versions of Firefox. I would strongly vote for not doing that. Instead we should follow the proposal from James on that patch and ship the geckodriver changes first. At a later point when Marionette fully supports handling the same flag for Firefox (including some previous releases) geckodriver can be updated again to just pass-through the commands and to not handle them on its own.
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 16•1 year ago
|
||
We agreed on to use a --enable-system-access command line argument for geckodriver which will just forward it to Firefox as --remote-enable-system-access if set. Even through the argument is not yet present for Firefox it will not cause failures when starting Firefox but just a log entry mentioning it as unrecognized argument. Marionette will then be updated on the follow-up bug in February or March as well.
| Assignee | ||
Comment 17•1 year ago
|
||
Adds a command line argument that gets forwarded to Firefox
and will control in future versions of Firefox when access
to the browser's parent process for eg. browser ui testing
is allowed.
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 18•1 year ago
|
||
Freddy, while we originally filed this as a security bug I wonder how much it still stands. We allow this feature for quite some time and now with the reviewed patch (to get landed) we will do the first step in restricting the access to the parent process by default. In geckodriver we are just forwarding the added argument to Firefox now, which will soon get this argument as well - and will only allow access to the parent process if the argument is specified when starting Firefox.
Can I just go ahead and land the patch or do we need a specific security review? Maybe we should rather do that for bug 1710425 and bug 1944565?
| Assignee | ||
Comment 19•1 year ago
|
||
Oh, I just stumbled over the following document when I tried to open lando for this patch:
https://firefox-source-docs.mozilla.org/bug-mgmt/processes/security-approval.html#on-requesting-sec-approval
Given that we have sec-want I can just push the changes.
Comment 20•1 year ago
|
||
Comment 21•1 year ago
|
||
Backed out for causing btime failures
- Backout link
- Push with failures
- Failure Log
- Failure line:
raptor-main Critical: TEST-UNEXPECTED-FAIL: no raptor test results were found for constant-regression
Comment 22•1 year ago
|
||
Yes, fine to land. Is this something that impacts production / end-user builds of Firefox or is this solely for users of geckodriver? The latter is fine. The former should really get a security review :)
| Assignee | ||
Comment 23•1 year ago
|
||
The problem was that I missed to update a line when getting the command line flag and it was referencing still the old name of the flag. I was able to reproduce it with starting geckodriver without any arguments:
✗ geckodriver git:(geckodriver-system-access↑1|…3
thread 'main' panicked at testing/geckodriver/src/main.rs:259:29:
Mismatch between definition and access of `enable_system_access`. Unknown argument or group id. Make sure you are using the argument id and not the short or long flags
I'll push a fix.
| Assignee | ||
Comment 24•1 year ago
|
||
(In reply to Frederik Braun [:freddy] from comment #22)
Yes, fine to land. Is this something that impacts production / end-user builds of Firefox or is this solely for users of geckodriver? The latter is fine. The former should really get a security review :)
This change is for geckodriver only. I'll get back to you over on the other bug (where I've already needinfo'ed you).
| Assignee | ||
Updated•1 year ago
|
Comment 25•1 year ago
|
||
Comment 26•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 27•1 year ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #18)
Freddy, while we originally filed this as a security bug ...
You didn't, actually! It's filed as "employee confidential" which is given the description Confidential Mozilla Employee Bug (non-security); It is explicitly labeled "not a security bug".
The sec-want tag means my team wants to track it as a security enhancement but it's not a vulnerability. Whether those bugs are hidden or not depends on what the enhancement might imply about other existing vulnerabilities.
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #19)
Oh, I just stumbled over the following document when I tried to open lando for this patch:
https://firefox-source-docs.mozilla.org/bug-mgmt/processes/security-approval.html#on-requesting-sec-approval
Did lando point you there for this bug? We might need to fix that. That instruction applies to "Security" bugs, not "Confidential" bugs. At the top of this bug you can see a violet banner with the word "CONFIDENTIAL" in it. On a security bug you'll see an orange banner, with the words "SECURITY ISSUE - APPROVAL PROCESS" where "approval process" is a link to that document.
Comment 28•1 year ago
|
||
If there are other geckodriver/remote protocol security bugs that are currently "confidential" instead of in a security group we'd appreciate it if you could change those. If you run into permission problems doing that I will be happy to help.
("needinfo'd" so this request doesn't get lost in bugspam, but not actually a question that needs a response in this bug)
Updated•1 year ago
|
| Assignee | ||
Comment 29•1 year ago
|
||
(In reply to Daniel Veditz [:dveditz] from comment #27)
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #19)
Oh, I just stumbled over the following document when I tried to open lando for this patch:
https://firefox-source-docs.mozilla.org/bug-mgmt/processes/security-approval.html#on-requesting-sec-approvalDid lando point you there for this bug? We might need to fix that. That instruction applies to "Security" bugs, not "Confidential" bugs. At the top of this bug you can see a violet banner with the word "CONFIDENTIAL" in it. On a security bug you'll see an orange banner, with the words "SECURITY ISSUE - APPROVAL PROCESS" where "approval process" is a link to that document.
Good question which I cannot answer anymore now. But I'll keep it in mind when attaching a revision to Phabricator for another confidential bug. If that's the case I can certainly file a bug. Thanks Dan!
Description
•