← All issues

[11] [WebCore] Defer Safe Browsing download decision until lookup completes

Severity: Medium | Component: WebKit UIProcess navigation policy | 4b574bf

Medium으로 평가한 이유는, 이 diff가 PolicyAction::Download 결정을 safeBrowsingCheckOngoing()이 false가 될 때까지 지연시키기 때문입니다. 패치 이전에는 download 정책이 적용된 URL 중 Safe Browsing 조회가 완료되지 않은 경우, 경고가 완전히 생략되었습니다. 다만 영향 범위는 사용자가 이미 download를 선택한 URL에 한정됩니다.

decidePolicyForNavigationActiondecidePolicyForResponseSharedsafeBrowsingCheckOngoing() 상태에서 Download를 더 이상 동기적으로 적용하지 않습니다. navigation별 completion-callback queue가 조회 완료 시점까지 결정을 보류합니다. 조회가 완료되면 callback이 safeBrowsingWarning()을 재확인하여 차단 또는 진행 여부를 결정합니다.

Source/WebKit/UIProcess/WebPageProxy.cpp

- if (action == PolicyAction::Download && navigation->safeBrowsingWarning()) {
- // 경고 표시
- }
+ if (action == PolicyAction::Download) {
+ if (navigation->safeBrowsingCheckOngoing()) {
+ navigation->queueDownloadDecision(WTFMove(continuation));
+ return;
+ }
+ // 경고 재확인, 차단 또는 진행
+ }

Download 경로에서의 Safe Browsing TOCTOU: 느린 remote 조회 결과가 도착하기 전에 download가 WKDownload로 넘겨져 경고가 우회되는 문제입니다.

API::Navigation에 새로운 completion-callback queue가 추가되었습니다. safeBrowsingCheckOngoing()이 해제되는 시점에 이 queue가 처리됩니다. subframe 차단은 provisional-load error를 발생시키고, main-frame 차단은 interstitial을 표시합니다. *PostTimeout regression test는 약 250ms의 listener timeout window를 검증하며, 이 구간에서 취약점이 안정적으로 재현 가능했습니다.

WebKit의 Safe Browsing 조회는 remote 서비스를 대상으로 비동기적으로 실행됩니다. 일반 페이지 로드는 navigation 시작 이후에도 늦게 interstitial을 표시할 수 있습니다. 그러나 download는 WKDownload에 일단 넘겨지면, 이후 도착한 경고로는 취소할 수 없습니다.

패치 이전에는 policy handler가 Download를 적용할 때 safeBrowsingWarning()을 동기적으로 평가했습니다. 조회가 미완료된 상태에서는 safeBrowsingWarning()이 null을 반환하므로 download가 진행됩니다. 느리거나 remote 조회라면 이 상황은 흔히 발생하며, TOCTOU window는 결과적으로 조회 지연 시간 전체를 아우르는 셈입니다.

🔒

The interaction between an asynchronous reputation check and a non-retractable policy action is examined in detail, along with the practical attacker model and the limits of what this bypass yields.

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

🔒

Four reusable audit patterns identified, covering other consumers of the same asynchronous gate and the broader class of non-retractable policy decisions in the UIProcess.

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