Run PAC Scripts without Javascript Optimizations
Categories
(Core :: Networking, enhancement)
Tracking
()
People
(Reporter: tjr, Assigned: jandem)
References
Details
(Keywords: csectype-sandbox-escape, sec-want, Whiteboard: [post-critsmash-triage])
Attachments
(2 files)
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
jcristau
:
approval-mozilla-release+
tjr
:
sec-approval+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr68+
|
Details | Review |
Bug 1607443 was a report about a JS bug exploited in the parent via a PAC script.
If we disabled JS Engine optimizations for PAC scripts, we would eliminate a lot of local-network-accessible attack surface available in the parent process.
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Or don't run it in a privileged process at all? Is that a separate bug or an alternative to disabling the JIT? The JIT isn't the only source of exploitable JS bugs we've had.
Reporter | ||
Comment 2•5 years ago
|
||
(In reply to Daniel Veditz [:dveditz] from comment #1)
Or don't run it in a privileged process at all? Is that a separate bug or an alternative to disabling the JIT? The JIT isn't the only source of exploitable JS bugs we've had.
We could run it in the socket process. That would be nice. But I think deploying the Socket process is far enough away to consider disabling mitigations in the meantime... (Adding Dragana to see what she thinks.)
Comment 3•5 years ago
•
|
||
I assumed it did run in the socket process. Have we not shipped that? I have one in Nightly on mac but it appears not to be sandboxed so I'm not sure that helps much. (Maybe it's partially sandboxed and just doesn't trip the Activity Monitor "sandbox" definition?)
[Confirmed that Firefox 72 on Mac does NOT have a socket process]
Assignee | ||
Comment 4•5 years ago
|
||
We should consider disabling WebAssembly in PAC scripts too. Maybe a per-runtime override to turn off all native codegen (JS JITs, Wasm, regexp JIT).
Comment 5•5 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #4)
We should consider disabling WebAssembly in PAC scripts too. Maybe a per-runtime override to turn off all native codegen (JS JITs, Wasm, regexp JIT).
For JS and regex there's a fallback to the interpreter, though; for wasm there's not (and we don't want to add an interpreter i think). That said, only very large PAC scripts would likely benefit from wasm, so this seems sensible for now.
Comment 6•5 years ago
|
||
Running elsewhere should probably be a different bug. Disabling JITs is a reasonable sized problem that we can tackle in these next few weeks and can be discussed here.
Comment 7•5 years ago
|
||
Socket process is far in the future. There is one but it is use only for WebRTC. We plan to try to turn the socket process on Nightly in 76 (the project was de-prioritized). The socket process is not sandboxed yet. I agree with statement above that we should start by disabling JITs
I can have look if we can run it elsewhere. I will open another bug for that.
Assignee | ||
Comment 8•5 years ago
|
||
We investigated disabling Ion in the parent process (bug 1608102), but the main blocker there is devtools performance. I'm going to add a per-context override to disable Ion just for the PAC runtime.
We should continue to look into other PAC mitigations too; we've had non-JIT security bugs as well.
Assignee | ||
Comment 9•5 years ago
|
||
Comment 10•5 years ago
|
||
Comment on attachment 9119990 [details]
Bug 1607494 - Disable Ion for the PAC script thread. r?tcampbell!
Security Approval Request
- How easily could an exploit be constructed based on the patch?: This mitigates part of the chain we believe was used in CVE-2019-17026. There seems to be twitter discussion suggesting this is externally known, so the cat is probably out of the bag.
- Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: Unknown
- Which older supported branches are affected by this flaw?: All
- If not all supported branches, which bug introduced the flaw?: None
- Do you have backports for the affected branches?: No
- If not, how different, hard to create, and risky will they be?: ESR68 will need a different patch, but that patch is a single line since enableIon was a per-context flag at the time.
- How likely is this patch to cause regressions; how much testing does it need?: This prevents compiling into the highest tier JIT. There is already a pref to disable Ion globally, this just forces the PAC context to always disable. Stability risk is low. If there are extreme uses of PAC, they may see a perf impact without Ion.
Comment 11•5 years ago
|
||
Requesting sec-approval just to make sure. We should get this into nightly and beta. If there are further point releases in 72, it might be beneficial to ship too.
Reporter | ||
Comment 12•5 years ago
|
||
Hey Mike - we would really like to turn off Javascript optimizations for PAC scripts. I expect that enterprises are the only people who are running huge PAC scripts... do you have any anecdotal data about that? If it's ever come up before? Should we consider a pref for them? Do you think we could land it on ESR as 68.4.2 or 68.5 or would you want it to wait until the next big ESR release?
Reporter | ||
Comment 13•5 years ago
|
||
Comment on attachment 9119990 [details]
Bug 1607494 - Disable Ion for the PAC script thread. r?tcampbell!
Approved to land and request uplift. The 'PAC scripts run in the parent process' exploit technique is publicly known, I don't see any reason to try to obfuscate what we're doing here.
Comment 14•5 years ago
|
||
I know that some folks have some big PAC scripts, but I'm not sure the attack surface is worth it.
I'm fine with turning it off in the ESR dot release and if we get pushback, we can address it in another rlease.
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
Comment 17•5 years ago
|
||
[Tracking Requested - why for this release]:
This is a hardening patch as follow up to a security incident. If a point-release happens for 72, this is a lower-risk change to consider including.
Patch is currently on autoland and will be in next NIghtly. I will request better uplift by or before Monday.
Comment 18•5 years ago
|
||
Comment 19•5 years ago
|
||
Seems like we want this in Fx73/68.5esr at a minimum. I'm less certain about 72.0.2 (and presumably 68.4.2esr if we take it for 72).
Assignee | ||
Comment 20•5 years ago
|
||
Comment on attachment 9119990 [details]
Bug 1607494 - Disable Ion for the PAC script thread. r?tcampbell!
Beta/Release Uplift Approval Request
- User impact if declined: Security - potential JIT bugs could be triggered via PAC scripts and execute directly in the parent process.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Main risk is perf impact but in practice most PAC scripts are probably small and not too perf-sensive, and most users don't use PAC scripts.
- String changes made/needed: N/A
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 21•5 years ago
|
||
Comment on attachment 9119990 [details]
Bug 1607494 - Disable Ion for the PAC script thread. r?tcampbell!
Approved for 73.0b5 and 68.5esr. Leaving the release request for Julien to evaluate.
Updated•5 years ago
|
Comment 22•5 years ago
|
||
uplift |
Comment 23•5 years ago
|
||
uplift |
Comment 24•5 years ago
|
||
Comment on attachment 9119990 [details]
Bug 1607494 - Disable Ion for the PAC script thread. r?tcampbell!
mitigation for sec issues, approved for 72.0.2
Updated•5 years ago
|
Comment 25•5 years ago
|
||
uplift |
Landed on FIREFOX_ESR_68_4_X_RELBRANCH for 68.4.2.
https://hg.mozilla.org/releases/mozilla-esr68/rev/ec4175ed144b80188abcba4486ee7f03dbc2cc06
Comment 26•5 years ago
|
||
uplift |
Comment 27•5 years ago
|
||
No advisory for this?
Comment 28•5 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #27)
No advisory for this?
AIUI that's correct as this is hardening not fixing a specific flaw.
Reporter | ||
Comment 29•5 years ago
|
||
(In reply to Julien Cristau [:jcristau] from comment #28)
(In reply to Mike Hommey [:glandium] from comment #27)
No advisory for this?
AIUI that's correct as this is hardening not fixing a specific flaw.
Correct.
Updated•4 years ago
|
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 30•3 years ago
|
||
I'm going to give this the csectype-sandbox-escape, keyword to capture the PAC attack vector, even if this exact bug does not explicitly cover it.
Description
•