[PR #3062] [MERGED] fix(macOS): preserve app signature and scope launchd socket #3066

Closed
opened 2026-10-15 04:07:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3062
Author: @BorClaw
Created: 8/26/2026
Status: ✅ Merged
Merged: 8/27/2026
Merged by: @vkamn

Base: dev ← Head: fix/macos-plist-install-hardening


📝 Commits (2)

  • 6ad2608 fix(macos): preserve signed service plist resource
  • 0648ed3 fix(macos): bind service socket to loopback

📊 Changes

2 files changed (+3 additions, -1 deletions)

View changed files

📝 deploy/data/macos/AmneziaVPN.plist (+2 -0)
📝 deploy/data/macos/post_install.sh (+1 -1)

📄 Description

Summary

  • preserve the signed AmneziaVPN.plist resource inside the installed app bundle
  • bind launchd's compatibility/service socket to loopback instead of every IPv4 interface

Problem

The macOS post_install.sh currently moves Contents/Resources/AmneziaVPN.plist to /Library/LaunchDaemons. Because that resource is part of the signed app bundle, the installed app no longer passes sealed-resource validation:

$ codesign --verify --deep --strict --verbose=4 /Applications/AmneziaVPN.app
/Applications/AmneziaVPN.app: a sealed resource is missing or invalid
file missing: /Applications/AmneziaVPN.app/Contents/Resources/AmneziaVPN.plist

The LaunchDaemon plist also creates a passive TCP listener on every IPv4 interface:

$ netstat -anv -p tcp | grep 5959
tcp4  0  0  *.5959  *.*  LISTEN  ...  launchd:1

The service's actual client IPC is implemented with QLocalServer at /var/run/amneziavpn/daemon.socket (falling back to /tmp/amneziavpn.socket), so the launchd TCP socket does not need LAN exposure.

Observed with release 5.0.1.5 on macOS 26.3.1 arm64. The same installer/plist behavior is still present on dev.

Changes

  1. Copy the plist into /Library/LaunchDaemons instead of moving it out of the signed bundle.
  2. Set SockNodeName to 127.0.0.1 for the launchd socket.

This keeps the app bundle intact while retaining the existing LaunchDaemon installation and socket activation behavior.

Validation

  • bash -n deploy/data/macos/post_install.sh
  • plutil -lint deploy/data/macos/AmneziaVPN.plist
  • git diff --check

No changes were applied to the live installation while preparing this PR.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amnezia-client/pull/3062 **Author:** [@BorClaw](https://github.com/BorClaw) **Created:** 8/26/2026 **Status:** ✅ Merged **Merged:** 8/27/2026 **Merged by:** [@vkamn](https://github.com/vkamn) **Base:** `dev` ← **Head:** `fix/macos-plist-install-hardening` --- ### 📝 Commits (2) - [`6ad2608`](https://github.com/amnezia-vpn/amnezia-client/commit/6ad2608ed74fc58e2e8170d037f0caadf0929cf9) fix(macos): preserve signed service plist resource - [`0648ed3`](https://github.com/amnezia-vpn/amnezia-client/commit/0648ed3d114ddec397a1832dfd22c3e4532590cd) fix(macos): bind service socket to loopback ### 📊 Changes **2 files changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `deploy/data/macos/AmneziaVPN.plist` (+2 -0) 📝 `deploy/data/macos/post_install.sh` (+1 -1) </details> ### 📄 Description ## Summary - preserve the signed `AmneziaVPN.plist` resource inside the installed app bundle - bind launchd's compatibility/service socket to loopback instead of every IPv4 interface ## Problem The macOS `post_install.sh` currently moves `Contents/Resources/AmneziaVPN.plist` to `/Library/LaunchDaemons`. Because that resource is part of the signed app bundle, the installed app no longer passes sealed-resource validation: ```text $ codesign --verify --deep --strict --verbose=4 /Applications/AmneziaVPN.app /Applications/AmneziaVPN.app: a sealed resource is missing or invalid file missing: /Applications/AmneziaVPN.app/Contents/Resources/AmneziaVPN.plist ``` The LaunchDaemon plist also creates a passive TCP listener on every IPv4 interface: ```text $ netstat -anv -p tcp | grep 5959 tcp4 0 0 *.5959 *.* LISTEN ... launchd:1 ``` The service's actual client IPC is implemented with `QLocalServer` at `/var/run/amneziavpn/daemon.socket` (falling back to `/tmp/amneziavpn.socket`), so the launchd TCP socket does not need LAN exposure. Observed with release `5.0.1.5` on macOS 26.3.1 arm64. The same installer/plist behavior is still present on `dev`. ## Changes 1. Copy the plist into `/Library/LaunchDaemons` instead of moving it out of the signed bundle. 2. Set `SockNodeName` to `127.0.0.1` for the launchd socket. This keeps the app bundle intact while retaining the existing LaunchDaemon installation and socket activation behavior. ## Validation - `bash -n deploy/data/macos/post_install.sh` - `plutil -lint deploy/data/macos/AmneziaVPN.plist` - `git diff --check` No changes were applied to the live installation while preparing this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 04:07:16 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#3066
No description provided.