"MyXterm.app is damaged": what macOS actually checks

By Pavel Stegnii · Published · All articles

Short version. Nothing in the download was damaged. Our app bundle carried only the signature the linker puts on the executable, and the bundle's resources were never sealed. codesign calls that an invalid signature, and for a file downloaded from the internet macOS words it as damaged, with no way to open it anyway. Pull request #54 signs the bundle properly (ad hoc) and fails the build if the signature doesn't verify. The real fix is a Developer ID signature and notarization, which needs a paid Apple developer account we don't have yet.

The symptom

On 30 November 2026 the macOS preview, downloaded from this site onto a second Mac, didn't open. macOS said:

"MyXterm.app" is damaged and can't be opened. You should move it to the Trash.

There was no Open Anyway button, and none in Privacy & Security either. On the Mac it was built on, the same app opened fine. That difference is the first clue: the Mac that built it never saw it as a download.

What a bundle signature covers

A macOS app is a folder. The executable sits in Contents/MacOS, next to Info.plist, resources and, in our case, a helper program for RDP. A signed bundle also has Contents/_CodeSignature/CodeResources: a list of every other file with its hash, sealed by the signature.

On Apple silicon the linker signs every executable it writes with an ad hoc signature, because arm64 code must be signed to run at all [3]. Our build script copied that executable into the bundle and stopped there. The executable's signature said the bundle around it should have sealed resources; the bundle had none.

The app bundle before and after the fix Before: only the main executable carries the linker's ad hoc signature, the helper is unsigned and there is no CodeResources file, so the resources are not sealed. After: the helper is signed first, then the bundle, which writes CodeResources and seals every file. Before MyXterm.app/Contents/ Info.plist MacOS/myxterm linker's ad hoc signature only MacOS/myxterm-rdp-engine not signed by us _CodeSignature/ missing: resources not sealed After pull request #54 MyXterm.app/Contents/ Info.plist MacOS/myxterm signed with the bundle MacOS/myxterm-rdp-engine signed first, ad hoc _CodeSignature/CodeResources every file sealed by its hash
The same files, signed in the right order. Ad hoc means signed without a certificate: it proves the files are intact, not who made them.

codesign reports it plainly. This is what it said about the bundle from the CI build [1]:

$ codesign --verify --deep --strict --verbose=2 MyXterm.app
MyXterm.app: code has no resources but signature indicates they must be present

What macOS checks on first open

A browser marks every file it downloads with the com.apple.quarantine extended attribute. The first time you open a quarantined app, Gatekeeper checks its signature and whether Apple has notarized it [4]. Apps built on your own Mac never get that attribute, which is why the app opened on the build Mac.

For an app that is intact but not notarized, Gatekeeper says it can't verify the developer, and Privacy & Security offers Open Anyway. For an app whose signature doesn't verify, it says the app is damaged and offers nothing. Our bundle fell into the second group: not because a byte had changed, but because the signature described files it didn't seal.

The fix

Pull request #54, merged on 30 November 2026 [1], changed cargo xtask bundle-macos, the step that assembles MyXterm.app:

  1. Sign the RDP helper ad hoc.
  2. Sign the bundle ad hoc, which signs the main executable and writes CodeResources. Nested code first, then its container, as Apple recommends, instead of --deep [3].
  3. Run codesign --verify --deep --strict and fail the build if it doesn't pass.

On the CI-built app, after signing, codesign --verify reports the bundle valid on disk and that it satisfies its Designated Requirement, with sealed resources covering 4 files. spctl, which asks Gatekeeper's question, still rejects it. That is expected: it is not notarized.

With that, a downloaded copy should get the ordinary can't be verified prompt and Open Anyway in Privacy & Security, as our macOS download page describes. We haven't seen that dialog on screen yet with a new download; until we have, treat it as expected, not confirmed.

Why notarization is the real fix

An ad hoc signature proves the files weren't changed after signing. It says nothing about who signed them. A Developer ID signature ties the app to a developer Apple has verified, and notarization adds Apple's automated check of the uploaded app; Gatekeeper then opens it after the usual downloaded from the internet question [5]. Both need a membership in the Apple Developer Program, which costs money, so it is the project owner's decision. Until then, macOS builds are ad hoc signed and say so.

Sources

Read on 1 December 2026. Pull requests, commits and the lab log are in the MyXterm repository.

  1. Pull request #54, macOS app downloads no longer reported as damaged: github.com/adramelech/MyXterm/pull/54, commit 256a984
  2. MyXterm changelog, the entry for macOS downloads: CHANGELOG.md
  3. Apple Developer documentation, creating distribution-signed code for macOS: developer.apple.com/documentation/xcode/creating-distribution-signed-code-for-the-mac
  4. Apple Platform Security, Gatekeeper and runtime protection in macOS: support.apple.com/guide/security/sec5599b66df
  5. Apple Developer documentation, notarizing macOS software before distribution: developer.apple.com/documentation/security/notarizing-macos-software-before-distribution

Last updated