← All issues

[26] WKDateTimePicker SetForScope writes to freed self

Severity: Medium | Component: WebKit UIProcess iOS forms | 7b904b1

Medium severity로 분류됩니다. diff는 UI process 내의 UAF를 수정합니다. [_datePickerController dismissViewControllerAnimated:NO completion:nil] 호출 도중 runloop 작업이 재진입하면서 WKDateTimePicker에 대한 마지막 reference가 해제됩니다. 이때 _isDismissingDatePicker에 바인딩된 SetForScope RAII guard가 self보다 오래 살아남아, scope 종료 시점에 이미 해제된 메모리에 NO를 기록했습니다.

Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm

- (void)removeDatePickerPresentation
{
if (_datePickerController) {
if (!_isDismissingDatePicker) {
SetForScope isDismissingDatePicker { _isDismissingDatePicker, YES };
- [_datePickerController dismissViewControllerAnimated:NO completion:nil];
+ [protect(_datePickerController) dismissViewControllerAnimated:NO completion:nil];
}
_datePickerController = nil;
}
}

Objective-C re-entrancy 경계에서 RAII scope-guard가 enclosing 객체보다 오래 살아남아 발생하는 use-after-free.

총 세 곳의 호출 지점이 수정되었습니다. removeDatePickerPresentation 외에, WKFormPeripheralBasebeginEditing/endEditing(controlBeginEditing/controlEndEditing 패턴)도 동일하게 처리되었습니다. 한편 WKDatePickerPopoverController.mm에서도 같은 방식으로 __weak _delegate를 보호합니다.

🔒

The ownership and lifetime story behind a single-byte write into freed UI-process memory, including what an attacker would need to turn this into something more than a crash.

더 확인하려면 구독해 주세요

🔒

Four reusable audit patterns identified, covering RAII scope guards, IPC-driven UIKit dismissal paths, and weak-ivar dereferencing across WebKit's iOS UI process.

더 확인하려면 구독해 주세요