Skip to content

macOS Local Network permission is shared by Electron apps on the same Electron version (same LC_UUID) #55101

Description

@ArchitektApx

Preflight Checklist

Problem Description

macOS Local Network privacy uses the main executable's LC_UUID to identify an app. From Apple's TN3179: "If your main executable has no UUID, or shares a UUID with other programs, local network privacy may behave weirdly. To fix that, make sure your main executable has a UUID and that it's unique."

Electron's prebuilt executable has the same LC_UUID for every app on the same version and arch, and packagers copy it unchanged. So macOS mixes up apps that share an Electron version. I ran into this with T3 Code (Nightly) and Signal, both on Electron 44.4.5. T3 Code never got a prompt, and its LAN connections failed with EHOSTUNREACH.

Repro on macOS 27.0 (arm64) with stock Electron 44.4.4:

  1. Make two copies of Electron.app with different bundle ids (A and B), sign them ad hoc, and have each connect to a LAN address.
  2. Launch A and click "Don't Allow".
  3. Launch B. There's no prompt, and its connections fail with EHOSTUNREACH. The system log shows macOS resolving B to A by UUID:
LocalNetwork: found bundle id test.uuidcheck.B by PID
LocalNetwork: found bundle id test.uuidcheck.A by UUID 4C4C4403-5555-3144-A1BA-D4A9836F93B5

Proposed Solution

Give the main executable its own LC_UUID at package time, before signing, for example derived from the bundle id. I tested this with a third copy (C) where only the main executable was patched. macOS prompted for C, and after I allowed it, connections from both the main process and the network service helper worked, even though the helper kept the stock UUID. codesign --verify --deep --strict passes.

electron-builder asked me to file a issue here to get Electron's view before doing this (electron-userland/electron-builder#10297):

  1. Is Electron OK with packagers rewriting the main executable's LC_UUID?
  2. Should @electron/packager / Forge do it, so all packagers behave the same?
  3. If not, could Electron document it as a workaround?

Alternatives Considered

  • Granting Local Network to the other app works, but gives that app LAN access.
  • Electron can't fix this in its prebuilt binary, because every app ships the same one.

The patched executable no longer matches Electron's published dSYM. It's only the 53 KB launcher, though, and Electron Framework.framework is untouched, so only main() loses symbols. An opt-in setting would keep the default unchanged.

Additional Information

Activity

  1. eric1932 commented on Nov 23, 2026

    @eric1932

    Adding a real-world case involving shipping apps from three different vendors, plus a few details on how macOS handles the collision. Notably, this contradicts the "Granting Local Network to the other app works" point under Alternatives Considered above: here the colliding app was already allowed, yet the second app stayed blocked with no prompt and never appeared in System Settings.

    Setup

    • OS: macOS 26.7.3 (25G342), Apple Silicon
    • Apps: Antigravity 2.34.0 (com.google.antigravity, Google's IDE with a built-in coding agent that runs shell commands), OpenCode Desktop 2.3.2 (ai.opencode.desktop), and a third unrelated app
    • Shared binary: All three ship Electron 44.9.1 (arm64), and all three main executables share LC_UUID 4C4C447A-5555-3144-A121-6E56C3462D63. With code signatures stripped, the Antigravity and OpenCode main executables are byte-identical.
    • macOS UUID cache: /Library/Preferences/com.apple.networkextension.uuidcache.plist maps all three bundle IDs to that single UUID.

    What happens

    In /Library/Preferences/com.apple.networkextension.plist, OpenCode's rule was already allowed, while Antigravity's own rule was undetermined (DenyMulticast = true, MulticastPreferenceSet = false), so its traffic was denied.

    Antigravity never got a permission prompt, never appeared in System Settings → Privacy & Security → Local Network, and every LAN connection from it and its child processes (its integrated terminal and ssh commands run by its agent) failed with EHOSTUNREACH.

    On every blocked connection, the unified log shows UserEventAgent first identifying the right app by PID and then switching to OpenCode by UUID:

    UserEventAgent: LocalNetwork: found bundle id com.google.antigravity by PID
    UserEventAgent: LocalNetwork: found bundle id ai.opencode.desktop by UUID 4C4C447A-5555-3144-A121-6E56C3462D63
    

    With ai.opencode.desktop already having a decision, no prompt appeared — yet Antigravity stayed blocked under its own undetermined rule, even though OpenCode was allowed.

    Workaround and further observations

    In chronological order:

    1. Removing the colliding app unblocks the prompt: Moving OpenCode out of /Applications and unregistering it from LaunchServices (lsregister -u) caused nehelper to drop OpenCode's UUID mapping. The lookup then resolved to com.google.antigravity, the prompt finally appeared, and allowing it fixed Antigravity. The third app stayed installed the whole time (its own rule remained undetermined, still mapped to the same UUID), so removing OpenCode alone was enough. (I don't know how macOS picks among several bundle IDs mapped to one UUID.)
    2. Re-registering OpenCode triggers a misattributed prompt and rule: Moving OpenCode back and re-registering it (lsregister -f) caused nehelper to rebuild its UUID mapping. Ten seconds later, a LAN connection from Antigravity produced a prompt labelled "OpenCode". Accepting it created an NEPathRule with SigningIdentifier = ai.opencode.desktop and Path = /Applications/Antigravity.app/Contents/MacOS/Antigravity. (I can't tell from the log why macOS prompted again for an app that was already allowed.)
    3. System Settings hides the second app: System Settings → Privacy & Security → Local Network shows only a single row ("OpenCode") for the shared UUID. Antigravity is never listed there, even after its own rule becomes allowed, so its entry can't be seen or managed from the UI.

    Quick check for anyone affected

    # List main-executable UUIDs to spot duplicates across installed apps
    dwarfdump --uuid /Applications/*.app/Contents/MacOS/* 2>/dev/null | sort
    
    # Check whether UserEventAgent resolves a PID to a different bundle ID by UUID
    log show --last 1h --predicate 'process == "UserEventAgent" AND eventMessage BEGINSWITH "LocalNetwork:"'

    Takeaway

    Strongly +1 on having packagers (@electron/packager, electron-builder, etc.) write a unique LC_UUID into the main executable before signing, as proposed above — ideally by default rather than opt-in or docs-only. Every packaged macOS app using the stock Electron launcher is exposed whenever a user installs another vendor's app on the same Electron version, and most vendors will never notice.

    Alongside TN3179, Apple's TN3178: Checking for and resolving build UUID problems also states that every distinct Mach-O image should have its own unique UUID.

  2. mmaietta commented on Nov 23, 2026

    @mmaietta

    Strongly +1 on having packagers (@electron/packager, electron-builder, etc.) write a unique LC_UUID into the main executable before signing, as proposed above — ideally by default rather than opt-in or docs-only.

    Is Electron OK with packagers rewriting the main executable's LC_UUID?
    Should @electron/packager / Forge do it, so all packagers behave the same?
    If not, could Electron document it as a workaround?

    +1 on this. The dependency on my side is that I need an upstream "electron-approved" approach so that electron-builder implements the same strategy that packager would take.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions