A user of my AppKit, document-based app brought to my attention that when setting it as the default app to open a certain file with extension .md
(by choosing in the Finder "File > Open With > Other", then selecting my app and enabling "Always open with"), trying to open it with a double-click displays the warning "Apple could not verify [file] is free of malware that may harm your mac or compromise your privacy".
This is what happens for me:
- When keeping the default app for a
.md
file (Xcode in my case), the file opens just fine. - When choosing my app in the "File > Open With" menu, the file opens just fine in my app.
- But when setting my app as the default app (see above), the warning is displayed.
- From that moment on, choosing my app in the "File > Open With" menu doesn't work anymore. Selecting Xcode doesn't work either.
- Only setting Xcode again as the default app allows me to open it in Xcode, but my app still isn't allowed to open it.
Is this a macOS issue, or can I do anything in my app to prevent it? Where should I start looking for the issue in my code?
I've created FB19468486.
Thanks. I’ve updated your bug with my findings.
Originally I thought that this was related to Markdown, in that Markdown can contain HTML which can contain JavaScript and thus could be unsafe. However, I can reproduce this with a vanilla text document:
- On macOS 15.6, install and run BBEdit.
- Using Terminal, create a
test.txt
file. - Using Finder > File > Info > Open with, configure the file to open in BBEdit.
- Quarantine the file.
- Back in the Finder, double click the file.
You get a quarantine alert:
“test.txt” Not Opened
Apple could not verify "test.txt" is free of
malware that may harm your Mac or
compromise your privacy.
[Done] [[Move to Bin]]
Looking in the system log [1] I see this:
type: info
time: 2025-08-12 03:28:21.419703 -0700
process: XprotectService
subsystem: com.apple.xprotect
category: xprotect
message: SecAssessment results: {
"assessment:authority" = {
LSDownloadRiskCategoryKey = LSRiskCategoryHasRedirectedBinding;
"assessment:authority:flags" = 0;
"assessment:authority:source" = "no usable signature";
};
"assessment:remote" = 1;
"assessment:verdict" = 0;
} (null)
That LSRiskCategoryHasRedirectedBinding
value is inserted by Launch Services because of the “Open with” binding in step 3. That causes Gatekeeper to be more ‘paranoid’, which eventually results in this alert.
So:
- The alert is most definitely a feature, triggered by the quarantined document having an “Open with” binding.
- Speaking personally, I wish this alert had an ‘Open Anyway’ button, but we’ll have to wait to see how your bug pans out.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Once I enabled the recording of private data.