Blog

Fix "macOS cannot verify that this app is free from malware"

Learn how to fix the macOS Gatekeeper security warning. Step-by-step solutions including manual fixes, terminal commands, and automated AppleScript to bypass "cannot verify app" errors safely.

Fix "macOS cannot verify that this app is free from malware"

Why This Happens?

If you’ve ever tried to open a third-party macOS app and were met with the warning:

“macOS cannot verify that this app is free from malware”

You’re not alone.

This issue arises from Apple’s Gatekeeper security feature, introduced to protect users from potentially harmful software. Gatekeeper verifies that apps have been:

  • Downloaded from the Mac App Store, or
  • Signed with a valid Apple Developer ID certificate and not tampered with, and
  • (Starting with macOS Catalina) not quarantined by the system.

If your app is downloaded from the internet (e.g., via Chrome, Firefox, or third-party sites), macOS assigns it a “quarantine” attribute. Unless the developer has notarized the app with Apple, macOS will refuse to launch it, triggering that scary malware warning.

This doesn’t always mean the app is dangerous — just that it wasn’t officially notarized.

Quick Solutions to Try First

If you’re confident the app is safe (e.g., you built it yourself or trust the developer), you can bypass the warning manually:

  1. Right-click the App
    Instead of double-clicking the app to open it, right-click and select “Open”. You’ll get the same warning, but with an option to proceed.

  2. Use System Preferences
    After attempting to open the app once, go to: System Preferences → Security & Privacy → General
    At the bottom, you should see a button labeled “Open Anyway”.

  3. Temporarily Disable Gatekeeper (not recommended)
    If you’re comfortable in Terminal, you could use:

    sudo spctl --master-disable

    This disables Gatekeeper entirely — not ideal for regular use.

  4. Remove Quarantine Attribute You can manually remove the quarantine flag from the app using:

    xattr -d com.apple.quarantine /path/to/YourApp.app

This works for one app at a time.

But if you’re building or testing apps frequently, doing this over and over again becomes tedious…

Automate the Fix with AppleScript

To streamline this process, I created a simple AppleScript that: - Removes the quarantine attribute, and - Self-signs the app to avoid the warning altogether.

This is especially helpful for indie developers, testers, and anyone working with unsigned tools.

Here’s the script:

Final Thoughts

Gatekeeper is an important part of macOS security — and it’s doing its job. But for trusted apps and local development, it can feel like a hurdle.

If you’re hitting the “macOS cannot verify…” message often, try the manual fixes first. If it becomes a workflow bottleneck, my script might just save your sanity.

Stay safe — and smart — out there!