Skip to content

Remove get-task-allow entitlement from signed builds #1585

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

ychin
Copy link
Member

@ychin ychin commented Jul 23, 2025

This entitlement allows debugger to hook in to the app and allow other apps to call task_for_pid() on MacVim, and Apple has discouraged its use. In fact, the only reason why MacVim passes app notarization is because it has also set the disable-library-validation entitlement which allows get-task-allow to be set. We don't actually need get-task-allow in release binary builds as we don't intentionally want to allow external debuggers and code injection, so we should just remove it.

This was previously added in #980 where we made a mistake in assuming that get-task-allow was what was needed to sign the app with hardened runtime while allowing scripting interface (e.g. Python) to work, but that was wrong. It was the disable-library-validation entitlment instead, as we need the ability to load in unsigned libraries as Python distributions from say Homebrew are not signed.

Credit: This was pointed out by Karol Mazurek

This entitlement allows debugger to hook in to the app and allow other
apps to call `task_for_pid()` on MacVim, and Apple has discouraged its
use. In fact, the only reason why MacVim passes app notarization is
because it has also set the disable-library-validation entitlement
which allows get-task-allow to be set. We don't actually need
get-task-allow in release binary builds as we don't intentionally want
to allow external debuggers and code injection, so we should just remove
it.

This was previously added in macvim-dev#980 where we made a mistake in assuming
that get-task-allow was what was needed to sign the app with hardened
runtime while allowing scripting interface (e.g. Python) to work, but
that was wrong. It was the disable-library-validation entitlment
instead, as we need the ability to load in unsigned libraries as
Python distributions from say Homebrew are not signed.

Credit: This was pointed out by Karol Mazurek
@ychin ychin added this to the Release 182 milestone Jul 23, 2025
ychin added a commit to ychin/macvim that referenced this pull request Jul 23, 2025
By default, building MacVim locally will sign with an ad-hoc signature with no
entitlements. Release builds are then signed with the `macvim-signed`
target which signs MacVim with a valid signature and embed the
entitlments. This new target allows us to sign MacVim to have similar
entitlements and behaviors as a release build without needing an Apple
Developer signature.

There are currently two possible use cases for this:
1. Package managers like Homebrew can use this to build MacVim to get
   the correct hardened runtime entitlements.
2. Reproducible builds (macvim-dev#1506) can use this to generate a reproducible
   artifact. Proper release builds are not reproducible since there's no
   way for a proper digital signature to be reproduced, but we can strip
   and re-sign with an ad-hoc signature reproducibly using this target
   for a decent compromise.

Related: macvim-dev#1585
@ychin ychin merged commit b140515 into macvim-dev:master Jul 23, 2025
2 of 5 checks passed
@ychin ychin deleted the remove-get-task-allow branch July 23, 2025 01:25
ychin added a commit to ychin/macvim that referenced this pull request Jul 23, 2025
By default, building MacVim locally will sign with an ad-hoc signature with no
entitlements. Release builds are then signed with the `macvim-signed`
target which signs MacVim with a valid signature and embed the
entitlments. This new target allows us to sign MacVim to have similar
entitlements and behaviors as a release build without needing an Apple
Developer signature.

There are currently two possible use cases for this:
1. Package managers like Homebrew can use this to build MacVim to get
   the correct hardened runtime entitlements.
2. Reproducible builds (macvim-dev#1506) can use this to generate a reproducible
   artifact. Proper release builds are not reproducible since there's no
   way for a proper digital signature to be reproduced, but we can strip
   and re-sign with an ad-hoc signature reproducibly using this target
   for a decent compromise.

Related: macvim-dev#1585
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant