Markpad icon indicating copy to clipboard operation
Markpad copied to clipboard

Markpad keeps accessing for permissions to access the "Documents" folder even after it is granted.

Open nashv opened this issue 3 months ago • 2 comments

How did you install Markpad?

macOS — .dmg

App version

2.7.1

OS and version

26.5.2 (25F84)

Linux only: distribution, session and GPU/driver

No response

What happens

Markpad repeatedly keeps asking for permission to access the Documents folder, which has already been granted.

Even granting Full Disk Access permissions does not solve this.

What you expected

No response

Steps to reproduce

No response

The document, if one triggers it

No response

Screenshots

No response

Anything else

No response

nashv avatar Aug 06 '26 16:08 nashv

Confirmed on 2.7.1 / macOS 26, and I managed to pin down the exact mechanism. This is #209, but the root cause is more specific than "the grant doesn't persist" — the grant is there, it just stops matching.

Reproduced: created a file in ~/Documents, opened it from Finder (not via the Open panel), edited, ⌘S. macOS prompted, and tccd logged this:

Failed to match existing code requirement for subject com.alecdotdev.markpad
  and service kTCCServiceSystemPolicyDocumentsFolder
AUTHREQ_PROMPTING: service=kTCCServiceSystemPolicyDocumentsFolder,
  Resp:{identifier=Markpad-a48d6784acfd2352, binary_path=/Applications/Markpad.app/Contents/MacOS/Markpad}

The TCC entry existed and was set to "allowed" the entire time. What failed was the code requirement attached to it. Decoding the csreq blob stored next to the grant:

FADE0C00 | len | kind=1 | 07 (Or) | 08 (CDHash) len=20 <hash> | 08 (CDHash) len=20 <hash>

The stored requirement is literally cdhash H1 or cdhash H2. No identifier, no anchor, no team — because the release is ad-hoc signed (Signature=adhoc, TeamIdentifier=not set, spctl: no usable signature), TCC has no stable identity to bind the grant to, so it falls back to pinning the binary's hash.

What that means in practice, and why it is so confusing:

  • A cdhash changes with every build, so every update silently invalidates every folder grant — Documents, Desktop, Downloads and Full Disk Access alike.
  • System Settings keeps showing the app as allowed afterwards. The checkbox is real; the requirement behind it no longer matches. @nashv, that is almost certainly why Full Disk Access appears to do nothing for you — that entry is pinned to a previous build.
  • Approving the prompt rewrites the pinned hashes and does stop it. Verified here: after clicking Allow, a second ⌘S wrote with no prompt and no AUTHREQ_PROMPTING in the log. It holds until the next update.

Also worth recording: opening and reading from a protected folder never prompted in my testing — only writes do. So with Auto-save on, every automatic write is another chance to hit the prompt, and turning Auto-save off makes the problem nearly invisible without fixing anything.

Workarounds until this is addressed:

  1. When the prompt appears, just approve it. That alone re-pins the requirement to the current binary — there is no need to remove and re-add the app in System Settings. Since Markpad only checks for updates when you ask it to, this comes out to roughly one click per update.
  2. Keep Auto-save off for documents in Desktop/Documents/Downloads, so a stale grant costs one prompt at the next manual save rather than a stream of them.
  3. Keep working documents outside those three folders, which avoids TCC entirely.

The real fix is unchanged from #209 and is a maintainer decision: sign with a Developer ID Application certificate and notarize. The stored requirement then becomes identifier "..." and anchor apple generic and certificate leaf[subject.OU] = <team> — with no binary hash in it — so grants survive updates. tauri.conf.json still has "signingIdentity": null and "entitlements": null, and the release workflow still has no notarization step.

PathGao avatar Aug 06 '26 19:08 PathGao

Thank you for your detailed analysis. But there seem to be plenty of other cross-platform Tauri apps that are similarly unsigned and seem to not face this problem.

nashv avatar Aug 06 '26 20:08 nashv