The SUID sandbox helper binary was found, but is not configured correctly #17972
Comments
|
Unfortunately there's no way we can configure this correctly automatically, because setting the appropriate permissions requires root privileges and we don't want to ask for a root password during Ideally, Arch would configure its kernel support unprivileged CLONE_NEWUSER and Chromium (and Electron) could use the namespace sandbox instead of relying on the old setuid sandbox. Apps that are distributed on Linux will need to incorporate this into their install process. See electron-userland/electron-installer-debian#184 and electron-userland/electron-installer-redhat#112 for example. During development, we should probably print something out on |
|
Hey, thanks for the super quick response! Does unprivileged CLONE_NEWUSER come from Please let me know if there's anything I can do to help, or if this is expected output on Arch I'm happy to close -- I understand that there's some jankiness to be expected when running bleeding-edge distros and I don't mind resolving this in a |
|
|
|
Is there a possible workaround in the meantime until every linux distro enables those features? |
|
@kitingChris The setuid sandbox IS the workaround. You just need to ensure that when developing / releasing an electron app your dev / packaging scripts set the permissions of the sandbox helper correctly as @nornagon linked above. |
See the original message:
Also see here #16631 (comment) So to make suid sandbox work you basically have to tweak the
The issue is more severe though if running appimage/snap packages, I have not yet revealed a decent workaround for these cases. It's working if appimage is executed with |
Executing |
I confirm executing |
|
@vladimiry I needed to first chown and then chmod. The other way round it didn't work. |
|
@burningTyger you are right, I just have changed the original message. |
|
@nornagon If we |
* SUID sandbox related, see electron/electron#17972
|
same here is bad new fonction for what need to change that... :( |
* SUID sandbox related, see electron/electron#17972
|
@MarshallOfSound zip does not support permissions, but ultimately the issue is not the chmod permission, but rather the owner. The setuid sandbox helper is suid to root, because it needs to perform functions that are only available to root. If it were possible to set the appropriate permissions without first gaining root privileges, that would be a very serious vulnerability in Linux. Fortunately for Linux, and unfortunately for us, that is not the case. Here are the options as I see them:
I'm leaning towards (2). It would ease development without compromising the security of the deployed app. I'm not yet sure what to do about snap/flatpak, as I'm not familiar with their workings. It's possible that they already sandbox the app sufficiently that we can disable sandboxing altogether in that situation, as we do when building the Mac App Store version of Electron. |
|
As for now, I like more the first option.
Such scenario would be somehow misleading. One might be successfully running unpackaged app without sandboxing, but there is a chance that the packaged app won't work the same way with enabled sandboxing. Like, for example, the case when you access the main process from the renderer process not through the
So a packaged app that was designed and developed as sandboxed might be executed without sandbox if no sandbox available. This doesn't sound good to me.
What does it mean exactly? What would be the way to enable sandboxing on Linux in the way the app either starts or fails if no sandboxing available (the current situation, forced sandboxing). |
|
I also like (1), but to defend (2) a little, the API exposed to the app wouldn't change when disabling the sandbox. The only thing we would disable is the OS-level sandbox. We would still load the app the same way, it just wouldn't be protected by the OS. |
Then it sounds good to me too. Thanks for the explanation. |
As I said the appimage still requires special treatment. I repackage it and embed the |
the latest electron builder takes care of the no sanbox argument automatically in both snap and appimage. |
|
@vladimiry @p3x-robot
|
Could not yet locate in their code the appimage-specific snippet similar to this one applied for snaps (electron-userland/electron-builder#4496 still open). Anyway in my case repacking still required since I put there addition args, other than sanbox-related.
Correct. But modern electron builder sets 4755 internally. I check though that it's not set for snap/appimage since that would be a mistake. For example snap won't start with 4755 bit set to electron binary if I remember things correctly. |
|
@vladimiry I believe I won't need repacking in this case. But I could not find the right documentation of electron builder for doing that. Or do you think I'll also need repacking? Can you point me to the right documentation which can help me in how to do that. Additionally, I understand that I have both the options either setting 4755 bit or setting no-sandbox. |
If I remember things correctly, settings 4755 to appimage won't solve the issue. You need to (one of):
I doubt you will find detailed information about the issue in any documentation. I'm not aware of any relevant docs. |
electron builder latest embeds the |
|
@vladimiry @p3x-robot |
|
https://github.com/patrikx3/onenote
|
I just tested it using recent electron builder version and it doesn't embed the --no-sandbox in the ./AppRun sh script. If you start the appimage it fails with known |
weird, there are 10k snap installations with the latest electron builder. and definately the electron builder is shows that it adds that flag ... |
We are talking about appimage, not the snap thing. Snap of course has the arg embedded as I referenced above, here https://github.com/electron-userland/electron-builder/blob/df5d050e47f2030e48e65c0e3b542c3aec61e9de/packages/app-builder-lib/src/targets/snap.ts#L197-L202. |
you are right. i was thinking for some reason it was done in appimage, i even removed the code for the re-package and add no-sandbox, but i tried again and i see it is missing, so i added my revert of my build, no it works. sorry, in my corifeus-builder, you can see what i am doing: https://github.com/patrikx3/corifeus-builder/blob/master/src/utils/appimage/after-all-artifact-build.js |
|
Hi @nornagon considering how common this issue is, can the official electron quick-start tutorial be updated to include the work-around so newbies have a positive experience? Edit: Thanks to community encouragement I have opened a FR #26478 |
|
@gabefair That seems like a reasonable proposal. Would you be interested in opening a PR? |
Preflight Checklist
Issue Details
Expected Behavior
Running
node_modules/.bin/electron --versionshould outputv5.0.0.To be clear, all commands create this error, but I'm using the
--versionflag for simplicity.Actual Behavior
Additional Information
If I
chownandchmodthe file then it works fine, but my intuition is thatnpm install electron@latestshould work without those commands. Is this expected behavior?The text was updated successfully, but these errors were encountered: