Bug 209814

Summary: [macOS] Deny mach-lookup access to "com.apple.lsd.mapdb" in sandbox
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, darin, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 209861    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Per Arne Vollan 2020-03-31 09:17:51 PDT
The WebContent sandbox should deny mach-lookup access to "com.apple.lsd.mapdb" on macOS.
Comment 1 Per Arne Vollan 2020-03-31 09:26:01 PDT
Created attachment 395048 [details]
Patch
Comment 2 Per Arne Vollan 2020-03-31 10:15:09 PDT
Created attachment 395060 [details]
Patch
Comment 3 Per Arne Vollan 2020-03-31 12:28:56 PDT
Created attachment 395079 [details]
Patch
Comment 4 Radar WebKit Bug Importer 2020-03-31 12:29:25 PDT
<rdar://problem/61119618>
Comment 5 Darin Adler 2020-03-31 12:31:38 PDT
Comment on attachment 395079 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=395079&action=review

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:276
> +    // Map Launch Services database

WebKit coding style asks for a "." here.

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:360
> +#if HAVE(CSCHECKFIXDISABLE)
> +            // _CSCheckFixDisable() needs to be called before checking in with Launch Services.
> +            _CSCheckFixDisable();
> +#endif

Why does’t this belong inside the launchServicesCheckIn function?
Comment 6 Per Arne Vollan 2020-03-31 12:33:26 PDT
Created attachment 395080 [details]
Patch
Comment 7 Per Arne Vollan 2020-03-31 12:52:07 PDT
(In reply to Darin Adler from comment #5)
> Comment on attachment 395079 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=395079&action=review
> 
> > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:276
> > +    // Map Launch Services database
> 
> WebKit coding style asks for a "." here.
> 

Will fix.

> > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:360
> > +#if HAVE(CSCHECKFIXDISABLE)
> > +            // _CSCheckFixDisable() needs to be called before checking in with Launch Services.
> > +            _CSCheckFixDisable();
> > +#endif
> 
> Why does’t this belong inside the launchServicesCheckIn function?

That is a very good point. This would mean all other WebKit processes would get this, but I think that is only a good thing. I will update the patch.

Thanks for reviewing!
Comment 8 Per Arne Vollan 2020-03-31 13:23:20 PDT
Created attachment 395084 [details]
Patch
Comment 9 EWS 2020-03-31 17:45:20 PDT
Committed r259328: <https://trac.webkit.org/changeset/259328>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395084 [details].
Comment 10 WebKit Commit Bot 2020-04-01 09:47:12 PDT
Re-opened since this is blocked by bug 209861
Comment 11 Per Arne Vollan 2020-04-01 15:01:59 PDT
Created attachment 395207 [details]
Patch
Comment 12 EWS 2020-04-01 15:29:25 PDT
Committed r259366: <https://trac.webkit.org/changeset/259366>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395207 [details].