Skip to content

chore: Enable network sandbox by default on Windows #49143

Open

Description

@jkleinsc

Confirmation

Description

This change causes the following sandbox failure on Windows:

[8048:1204/002043.146:ERROR:sandbox\policy\win\sandbox_win.cc:777] Sandbox cannot access executable D:\a\electron\electron\src\out\Default\electron.exe. Check filesystem permissions are valid. See https://bit.ly/31yqMJR.: Access is denied. (0x5)
[8048:1204/002043.146:FATAL:sandbox\policy\win\sandbox_win.cc:565] DCHECK failed: false. 

xref: https://github.com/electron/electron/actions/runs/19911108203/job/57086003465#step:20:99

We should figure out how to enable this as an upgrade followup.

Activity

  1. added
    upgrade-follow-up
    on Dec 4, 2025
  2. added theissue type on Dec 4, 2025
  3. deepak1556 commented on Dec 5, 2025

    @deepak1556
    Member

    This was also hit by other embedders and looks like https://source.chromium.org/chromium/chromium/src/+/main:build/win/set_appcontainer_acls.py does the trick for testing environments that bundle the executable in a zip and extract in a different environment. We however also needed access to https://source.chromium.org/chromium/chromium/src/+/main:testing/scripts/common.py on the testing CI or just copy the relevant stuff.

  4. deepak1556 commented on Dec 5, 2025

    @deepak1556
    Member

    Couple more things to sort

  5. absidue commented on Dec 5, 2025

    @absidue

    Apps should update the app container SID with appropriate filesystem ACL, needs to be done as part of their installers. Current requirement is the icacls <install dir> /grant *S-1-15-2-2:(OI)(CI)(RX)

    I'm not sure what you mean by app container SID but it would be better if Electron did this itself, as requiring things to be done in an installer would make using an installer mandatory, breaking existing use cases such as shipping Electron apps in zip files or running them directly from the build output directory.

  6. deepak1556 commented on Dec 5, 2025

    @deepak1556
    Member

    I'm not sure what you mean by app container SID but it would be better if Electron did this itself,

    I am not aware of a way this can be achieved, happy to hear options.

    running them directly from the build output directory

    This step is covered by the build process https://source.chromium.org/chromium/chromium/src/+/main:build/config/BUILD.gn;l=269-276, as long as you run the executable on the same machine that built. If you are exporting to a different machine then you are required to set the appropriate ACL for the sandbox to work.

    breaking existing use cases such as shipping Electron apps in zip files

    I don't think this type of situation is new, linux already had it with its suid sandbox whose permissions cannot be preserved in zip. So the options for zip format is asking users to update the permissions or run without lpac sandbox.

  7. absidue commented on Dec 5, 2025

    @absidue

    I am not aware of a way this can be achieved, happy to hear options.

    Maybe I am asking too much here, but would it be possible to have Electron attempt to launch with the sandbox and if it fails continue launching without it and expose an API that would allow app developers to check if it is enabled so they could show appropriate instructions to users on how to solve to issue. A fuse could be added to allow app developers to opt-into a crash on launch if the sandbox fails, for developers that know for sure that their app will always use an installer.

    If you are exporting to a different machine then you are required to set the appropriate ACL for the sandbox to work.

    We are pulling the Electron binaries from the official GitHub releases, so yes that will definitely be a problem for us then.

    I don't think this type of situation is new, linux already had it with its suid sandbox whose permissions cannot be preserved in zip. So the options for zip format is asking users to update the permissions or run without lpac sandbox.

    Fun another thing to add to the growing list of FAQ entries on how to get the app running, nobody ever said security was convenient :) (just to be clear, I know that limitations and inconveniences inherited from upstream and caused by the operating systems are not your fault).

  8. deepak1556 commented on Dec 10, 2025

    @deepak1556
    Member

    Thats a valid suggestion, we can log and exit with an informative error when the sandbox is not usable with an early detection similar to https://source.chromium.org/chromium/chromium/src/+/main:content/browser/zygote_host/zygote_host_impl_linux.cc;l=128-139

    I wouldn't add a fuse for this but a cli flag to opt-out similar to --disable-gpu-sandbox we have today.

    expose an API that would allow app developers to check if it is enabled so they could show appropriate instructions to users on how to solve to issue.

    chrome://sandbox page is available for all electron apps that has the required information for each process.

  9. angwdev commented on Jun 4, 2026

    @angwdev

    How long do you think it would have taken us to find the solution without AI?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    upgrade-follow-up

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions