Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Allow to specify custom drivers path (for security reasons) #2317

Open
BeniFreitag opened this issue Sep 15, 2022 · 3 comments
Open

Comments

@BeniFreitag
Copy link

We use playwright to serve PDF files in an ASP.NET Web Application (currently .NET 4.8 with IIS but soon .NET core with IIS).

For security reasons all files of the Web Application are on a separate drive at P:\Projects\ProjectName\Website. On that drive Users have no access, just the App-Pool user can access files of the appropriate Project itself. This way all applications are isolated from each other. There were security bulletins in the last years highly recommending that approach.

In that setup Playwright fails, because node can't open files in P:\Projects\ProjectName\.playwright\, unless the App-Pool user has Read-Permission on both P:\ and P:\Projects. Otherwise it throws PlaywrightException: Process exited (details below). But this breaks the security aspects of isolating each application completely.

It's probably an issue of node which can't handle permissions just granted on a deeper level than on the root of a drive. Probably it's not on the top priorities of node to ever fix that.

Suggestion:
It would be valuable if the location of the .playwright directory could be specified in this case. Currently the .playwright directory must always be in the Application's directory. If it could be at a custom location, security can be configured as needed for node.

This is related to #2241 but affects both .NET 4.8 and ASP.NET Core. I could imagine that other projects will also benefit, if that .playwright directory could be in a custom path, for various reasons. #2241 would already solve that need.

Exception details (captured in transport.LogReceived):

node:internal/fs/utils:345 
    throw err; 
    ^ 
 
Error: EPERM: operation not permitted, lstat 'P:\' 
    at Object.realpathSync (node:fs:2461:5) 
    at toRealPath (node:internal/modules/cjs/loader:394:13) 
    at Function.Module._findPath (node:internal/modules/cjs/loader:550:22) 
    at resolveMainPath (node:internal/modules/run_main:19:25) 
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:71:24) 
    at node:internal/main/run_main_module:17:47 { 
  errno: -4048, 
  syscall: 'lstat', 
  code: 'EPERM', 
  path: 'P:\\' 
}
@cmeyer001
Copy link

I'd like to see a custom driver path option as well. I have several dotnet automation projects that can reside on a PC and the current location requires a .playwright folder to be located under the project folder of each project on a PC. A custom location would allow a .playwright folder to have a central location for multiple apps rather than installing the same folder on the same PC in multiple locations.

@pnocera
Copy link

pnocera commented Apr 15, 2024

I'm hitting the same issue here. Do you guys have some hints on how to overcome this ?
I'd like to still benefit from the lib updates.

@bkbartonDesign
Copy link

I'm looking for solutions to the same thing. +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants