Bug: "Thunderbird.app is damaged and can't be opened..." After macOS Update to 13.5.1
Status: RESOLVED
Priority: --
Resolution: FIXED
Created: 2023-09-07 03:23:10+00:00
Resolved: 2024-10-31 17:35:05+00:00

After updating to macOS 13.5.1 @mconley ran into a problem where both Firefox and Thunderbird were failing to launch. We didn't capture logs to debug Firefox, but some logs were collected to debug Thunderbird. The error is '“Thunderbird.app” is damaged and can’t be opened. You should move it to the Trash.'.

This was on Thunderbird 117.0b6, after updating macOS to version 13.5.1.

On Firefox, we've seen this problem after OS updates in some cases due to bug 1799332 which is being worked on now. In that bug, a modified file in the .app bundle breaks the codesigning signature causing macOS to fail to launch the app with the same error message.

Running `$ codesign -vvvv /Applications/Thunderbird.app` validates the signature of the bundle and reports problematic files.

Note: macOS tolerates some modification of files in the .app bundle and continues to launch the app without rechecking the signature every launch. However, after an OS update is one situation where we see signature re-checking. As a result, modification of files or additional files in the .app bundle can cause the application to fail to launch with this message after an OS update.

In this case, I suspect the update log files and extension listed below were causing the signature check to fail resulting in the launch failure. The update directory from the *Troubleshooting Information* page was reported as `/Users/mconley/Library/Caches/Thunderbird/updates/Applications/Thunderbird`.

```
$ codesign -vvvv /Applications/Thunderbird.app
--prepared:/Applications/Thunderbird.app/Contents/MacOS/rnpkeys
--validated:/Applications/Thunderbird.app/Contents/MacOS/rnpkeys
<omitting files for brevity>
--prepared:/Applications/Thunderbird.app/Contents/Library/Spotlight/thunderbird.mdimporter
--validated:/Applications/Thunderbird.app/Contents/Library/Spotlight/thunderbird.mdimporter
/Applications/Thunderbird.app: a sealed resource is missing or invalid
file added: /Applications/Thunderbird.app/Contents/MacOS/updates/backup-update.log
file added: /Applications/Thunderbird.app/Contents/MacOS/active-update.xml
file added: /Applications/Thunderbird.app/Contents/MacOS/updates/0/update.status
file added: /Applications/Thunderbird.app/Contents/MacOS/updates/last-update.log
file added: /Applications/Thunderbird.app/Contents/MacOS/updates.xml
file added: /Applications/Thunderbird.app/Contents/Resources/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi
```

From https://developer.apple.com/videos/play/wwdc2022/10096/
> Gatekeeper checks the integrity of newly-downloaded apps. In macOS Ventura, Gatekeeper will now check the integrity of all notarized apps, not just quarantined apps.
>
> First, apps need to be properly signed. Starting with macOS Ventura, if your notarized app is no longer validly signed, it will be blocked by Gatekeeper on first launch. You should sign all your executables and bundles and ensure that their signatures stay valid when you make changes to your apps. In addition to an integrity check, Gatekeeper will also prevent your app from being modified in certain ways."