-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Executing SUID binaries not possible in v5 #18521
Comments
Just to clarify, I'm not taking about the SUID sandbox - just about using |
What error are you seeing (if any)? What OS are you using (distro + version, kernel version)? Can you please make a small repro (e.g. using fiddle)? Thanks! |
The error is
And executing a custom binary instead shows that the SUID bit is not respected for child processes launched from the Electron renderer process. The OS is a fresh latest stable Elementary - I'll get you a repro tonight. |
Just to ask the obvious question, is |
Fiddle: https://gist.github.com/Eugeny/ec7be271806e2c16838977337b987606#file-renderer-js-L1
|
@nornagon have you been able to test the repro? |
I'm seeing this issue on Ubuntu 18.04 when using sudo-prompt in a simple example app. |
I'm running electron with const req = require('electron').remote.require;
const { execSync } = req('child_process');
execSync('sudo ls', { input: 'your-password\n' }); There were some deprecations in v5 related to Note: this is a Linux only issue for me, tested on Debian 9. |
Can confirm that this is a Linux-only issue, macOS works fine. |
Any traction on this? This has essentially rendered the Terminus project useless for many on Linux. |
Apparently, the root cause of this problem is this commit which was first introduced in v5.0.0-beta1. |
Ah, thanks for the detective work! Yes, it seems like that patch could cause this issue. I'm not sure that reverting it is the right call though, because we'd like to keep that protection in place for sandboxed processes (which can't call As a workaround, would it be possible to try launching the process from the main process instead of the renderer? The main process shouldn't have that flag set. |
Unfortunately not, as IPC would kill performance. |
@nornagon thanks for making the patch! |
Since v5, it's no longer possible to start setuid binaries from within an Electron renderer process - even with sandboxing disabled.
The text was updated successfully, but these errors were encountered: