-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on Launch in +[QNUserInfo bundle] #458
Comments
Hi, @goodones-mac |
No we don't, we just saw it in sentry. 9 users + 20 instances. We are also not a large app so I think it will show up a lot more in bigger apps. |
Could you please contact our technical support via Intercom (using our site)? I'll ask you for more details to help us understand the crash. |
This is most likely not a bug in your SDK, but a user who is running this on a jailbroken device. NSPredicate is the frequent target for exploit developers because it provides an easy and reliable way to convert security bugs into code execution. While it is difficult for them to restrict the API for third parties, Apple has started putting security checks in place that tries to block “suspicious” use of NSPredicate in their own apps. Whether these checks are effective or not is a different question (mostly not) but it does mean that constructs like the one in this SDK are flagged by them. Of course, what Apple does in their own apps is not supposed to have any effect on third-party apps like yours. Unfortunately, the way Apple enables these is by checking the process belongs to a platform application (vaguely, is it Apple signed and shipped with the system). If that is the case this additional validation enables itself. However, this is not the only thing that uses this platform application flag: there are all sorts of privileged and system behaviors that can only be performed by a platform application on iOS. A jailbreak needs the same level of access, of course. In theory it should grant itself these privileges and run third party apps as-is, but for various reasons most jailbreaks these day are sloppy and mark everything running on the system as a platform application. Usually having more privileges than normal is not a problem because third-party apps do not typically notice. However, Apple tries to enable the security feature on processes they believe are theirs and so when the jailbreak lies about this it ends up turning on for everyone. This is what is crashing your code. |
Just to round out the discussion I would also like to say that it’s probably not a good idea to try to detect jailbreak users or similar to work around this. My recommendation would be to avoid using NSPredicate here, which should be fairly straightforward to implement and also more efficient to boot. And if you’re looking to do even better I wouldn’t recommend using +allBundles at all, it’s probably overkill for what you’re doing. If you just need the main app binary, using another method (such as _NSGetExecutablePath) is probably a better bet since it doesn’t need to load all bundles. |
This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
@suriksarkisyan this is kind of a short time to auto-close an open issue like this, wondering if we can keep it open so it's tracked properly? |
Hi, @goodones-mac |
This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
I'm facing this issue July 1st, has it not been resolved any further? |
Hi there. |
Hi your SDK crashes on launch for us because of some issue with NSPredicate? It's happened about 20 times to our users according to sentry, but we haven't seen it in our Xcode builds. Might be a 'security' issue because you query all bundles and apple is getting more restrictive with bundle querying outside of your own app now and
_predicateSecurityAction
is in the stack?The function in question in your library:
Our code in the stack:
The text was updated successfully, but these errors were encountered: