AXIsProcessTrustedWithOptions returns NO even though the app is on the whitelist

zoul

We have a Mac App Store app that needs access to the Accessibility API. Since 10.9 Mavericks, there is a system whitelist for the apps that want to use the Accessibility API (System Preferences → Security & Privacy → Accessibility).

While testing an update for our app, we have noticed that right after the upgrade from the old version, system tells us that we don’t have a right to use the Accessibility API (AXIsProcessTrustedWithOptions returns NO), even though our app is on the whitelist, with the checkbox checked. Once we uncheck and recheck the permission, everything works fine.

Obviously, this is not a acceptable upgrade scenario for us, especially since the accessibility whitelist is buried so deep in System Preferences and can’t be accessed from code.

Is this a system bug? Is there a known workaround? We would accept having to recheck the Accessibility permissions after a big update – it just sucks navigating your users to the System Preferences only to see the checkbox already checked, without the feature working.

Updates:


During the first post-upgrade launch, the system complains in the console:

16/03/15 06:47:10,343 tccd[190]: Unable to verify code signing identity of com.company.app:  code failed to satisfy specified code requirement(s)
16/03/15 06:47:10,350 universalAccessAuthWarn[401]: AccessibilityAPI: pid 471, is not allowed to access the accessibility API. Path: /path/to/app

Weird thing is, once the permission checkbox on the accessibility whitelist is unchecked and rechecked, there are no errors in the console during the subsequent launches, even though the binary is the same.


I’ve peeked under the hood into the SQLite database implementing the access whitelist (/Library/Application Support/com.apple.TCC/TCC.db). The access table holds a csreq column that looks like some application fingerprint/hash blob:

$ sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db 'select client, quote(csreq) from access'
com.apple.dt.Xcode|X'…'
com.apple.AccessibilityInspector|X'…'
com.ourcompany.app|X'…'

(The quoted hashes were replaced with “…”.)

Now, if I install the older version of our app and run it, a hash is computed by the system and stored in the csreq column. If I perform a clean install of the new app version, I get a different hash.

When I install the old version and then delete it, the column still contains the hash for the old version. Could this be the source of the problem? Because when I set the column to NULL before updating the app, everything works fine. A new hash gets computed, the Accessibility API check returns YES as it should.


Same issue in a different app on GitHub.

zoul

There’s a thing called designated requirement (see the Code Signing Guide). Roughly speaking, it’s a set of criteria that system uses to determine if two app bundles represent the same app, security-wise. The designated requirement can be displayed using the codesign -dvv --req - YourApp.app command. In our case, the designated requirement check failed, since the older app version was signed using a different certificate than the development build.

In other words, when trying to replace a Mac App Store build with a development build, a security check will fail because of certificate mismatch and you will have to re-check some app permissions. As far as I know, this won’t happen when you have distributed and installed the same build through Mac App Store.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

GCC -v returns GCC 4.7.3 even though I unpacked 4.8.1?

From Dev

MongoDB for a specific id, query returns array even though size is 0

From Dev

PassportJS Facebook login isAuthenticated returns false even though authentication succeeds

From Dev

NSFetchRequest returns old data even though the database is updated

From Dev

MySQL select for update returns empty set even though a row exists

From Dev

function returning bool works even though it returns 1 or 0

From Dev

peekService returns null even though startService does not

From Dev

Why getmethod returns null even though the method exists

From Dev

Braintree - Transaction is successful even though fraud returns "Decline"

From Dev

isRegisteredForRemoteNotifications returns true even though I disabled it completely

From Dev

VBA Concatenation returns number even though Dimensioned as String

From Dev

dlsym returns NULL, even though the symbol exists

From Dev

Method returns true even though it should not. Possible complication with for loop

From Dev

QFile::copy returns true even though copy failed in Windows

From Dev

VLOOKUP Returns 0 even though there is a value in the line below the first result

From Dev

jOOQ returns offset date time as Z (UTC) even though it's not

From Dev

Firestore returns a document even though none exists

From Dev

Pandas apply returns indexing error even though indices look to be correct

From Dev

Core Data returns 1, even though there are zero objects fetched

From Dev

Firebase - method returns undefined even though value is not undefined

From Dev

NSFetchRequest returns old data even though the database is updated

From Dev

jscience Real comparison returns false even though values are equal

From Dev

PayPal IPN returns "INVALID" even though payment was processed

From Dev

compareTo returns -1 even though strings match Java

From Dev

Method returns true even though it should not. Possible complication with for loop

From Dev

VLOOKUP Returns 0 even though there is a value in the line below the first result

From Dev

C - regexec returns NOMATCH - even though it should?

From Dev

TryGetValue returns false even though the key exists

From Dev

hasNext() returns false, even though the file is not empty

Related Related

  1. 1

    GCC -v returns GCC 4.7.3 even though I unpacked 4.8.1?

  2. 2

    MongoDB for a specific id, query returns array even though size is 0

  3. 3

    PassportJS Facebook login isAuthenticated returns false even though authentication succeeds

  4. 4

    NSFetchRequest returns old data even though the database is updated

  5. 5

    MySQL select for update returns empty set even though a row exists

  6. 6

    function returning bool works even though it returns 1 or 0

  7. 7

    peekService returns null even though startService does not

  8. 8

    Why getmethod returns null even though the method exists

  9. 9

    Braintree - Transaction is successful even though fraud returns "Decline"

  10. 10

    isRegisteredForRemoteNotifications returns true even though I disabled it completely

  11. 11

    VBA Concatenation returns number even though Dimensioned as String

  12. 12

    dlsym returns NULL, even though the symbol exists

  13. 13

    Method returns true even though it should not. Possible complication with for loop

  14. 14

    QFile::copy returns true even though copy failed in Windows

  15. 15

    VLOOKUP Returns 0 even though there is a value in the line below the first result

  16. 16

    jOOQ returns offset date time as Z (UTC) even though it's not

  17. 17

    Firestore returns a document even though none exists

  18. 18

    Pandas apply returns indexing error even though indices look to be correct

  19. 19

    Core Data returns 1, even though there are zero objects fetched

  20. 20

    Firebase - method returns undefined even though value is not undefined

  21. 21

    NSFetchRequest returns old data even though the database is updated

  22. 22

    jscience Real comparison returns false even though values are equal

  23. 23

    PayPal IPN returns "INVALID" even though payment was processed

  24. 24

    compareTo returns -1 even though strings match Java

  25. 25

    Method returns true even though it should not. Possible complication with for loop

  26. 26

    VLOOKUP Returns 0 even though there is a value in the line below the first result

  27. 27

    C - regexec returns NOMATCH - even though it should?

  28. 28

    TryGetValue returns false even though the key exists

  29. 29

    hasNext() returns false, even though the file is not empty

HotTag

Archive