Unsafe navigation in Navigation (CVE-2026-3930)
On iOS Chrome, a server redirect during a page reload could navigate to a privileged chrome:// WebUI page because the reload transition bit was trusted without checking the previous page's origin. An attacker-controlled site could cause the browser to open internal configuration pages such as chrome://flags/.
- Fix shipped in 51 days
Report description
Privileged chrome:// navigation via reload-triggered server redirect in iOS Chrome
Bug location
Where do you want to report your vulnerability?
Chrome VRP – Report security issues affecting the Chrome browser. See program rules
Which URL (or repository) have you found the vulnerability in?
https://chromium.googlesource.com/chromium/src/
The problem
Please describe the technical details of the vulnerability
On iOS, Chrome embeds Chromium's ios/web navigation stack on top of WKWebView. The navigation delegate class CRWWKNavigationHandler contains special handling for "app-specific" URLs, which in the iOS Chrome configuration include internal chrome:// WebUI pages such as chrome://flags/.
The decision for whether to allow an app-specific navigation is implemented in ios/web/navigation/crw_wk_navigation_handler.mm:
- (BOOL)shouldAllowAppSpecificURLNavigationAction:(WKNavigationAction*)action
transition:
(ui::PageTransition)pageTransition {
GURL requestURL = net::GURLWithNSURL(action.request.URL);
DCHECK(web::GetWebClient()->IsAppSpecificURL(requestURL));
web::NavigationItem* lastItem =
self.webStateImpl->GetNavigationManager()->GetLastCommittedItem();
if (lastItem &&
(web::GetWebClient()->IsAppSpecificURL(lastItem->GetVirtualURL()) ||
web::GetWebClient()->IsAppSpecificURL(lastItem->GetURL()))) {
// Last committed page is also app specific and navigation should be
// allowed.
return YES;
}
if (pageTransition & ui::PAGE_TRANSITION_FORWARD_BACK) {
// Allow back-forward navigations.
return YES;
}
if (pageTransition & ui::PAGE_TRANSITION_RELOAD) {
// Allow reload navigations.
return YES;
}
// ... user-typed / bookmark and iframe cases omitted ...
return NO;
}
For an app-specific URL (such as a chrome:// page), the function unconditionally allows the navigation when the page transition has the PAGE_TRANSITION_RELOAD bit set, even if the last committed page was a regular web origin rather than an internal WebUI.
This method is called from the main navigation policy decision in the same file:
- (void)webView:(WKWebView*)webView
decidePolicyForNavigationAction:(WKNavigationAction*)action
preferences:(WKWebpagePreferences*)preferences
decisionHandler:
(void (^)(WKNavigationActionPolicy,
WKWebpagePreferences*))handler {
// ...
GURL requestURL = net::GURLWithNSURL(action.request.URL);
// ...
ui::PageTransition transition =
[self pageTransitionFromNavigationType:action.navigationType];
if (isMainFrameNavigationAction) {
web::NavigationContextImpl* context =
[self contextForPendingMainFrameNavigationWithURL:requestURL];
if (context &&
(!context->IsRendererInitiated() ||
(context->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK))) {
transition = context->GetPageTransition();
if (context->IsLoadingErrorPage()) {
decisionHandler(WKNavigationActionPolicyAllow);
return;
}
}
}
// ...
web::WebStatePolicyDecider::PolicyDecision policyDecision =
web::WebStatePolicyDecider::PolicyDecision::Allow();
if (web::GetWebClient()->IsAppSpecificURL(requestURL)) {
if (![self shouldAllowAppSpecificURLNavigationAction:action
transition:transition]) {
policyDecision = web::WebStatePolicyDecider::PolicyDecision::Cancel();
}
if (policyDecision.ShouldAllowNavigation()) {
[self.delegate navigationHandler:self createWebUIForURL:requestURL];
}
}
// ...
}
The page transition value used here is derived from WebKit's navigation type and, for main-frame navigations with an associated NavigationContext, from the context's GetPageTransition():
- (ui::PageTransition)pageTransitionFromNavigationType:
(WKNavigationType)navigationType {
switch (navigationType) {
case WKNavigationTypeLinkActivated:
return ui::PAGE_TRANSITION_LINK;
case WKNavigationTypeFormSubmitted:
case WKNavigationTypeFormResubmitted:
return ui::PAGE_TRANSITION_FORM_SUBMIT;
case WKNavigationTypeBackForward:
return ui::PAGE_TRANSITION_FORWARD_BACK;
case WKNavigationTypeReload:
return ui::PAGE_TRANSITION_RELOAD;
case WKNavigationTypeOther:
// ... heuristic for "Other" ...
}
}
Server-side redirects are handled in didReceiveServerRedirectForProvisionalNavigation:
- (void)webView:(WKWebView*)webView
didReceiveServerRedirectForProvisionalNavigation:(WKNavigation*)navigation {
// ...
GURL webViewURL = net::GURLWithNSURL(webView.URL);
web::NavigationContextImpl* context =
[self.navigationStates contextForNavigation:navigation];
if (!context) {
return;
}
// Redirecting to a data url is always unsafe.
if (webViewURL.SchemeIs(url::kDataScheme) ||
// Block redirects to JavaScript schemes.
webViewURL.SchemeIs(url::kJavaScriptScheme)) {
self.pendingNavigationInfo.unsafeRedirect = YES;
} else {
context->SetUrl(webViewURL);
}
// ...
}
Redirects to data: and javascript: are treated as unsafe, but redirects to other schemes (including chrome://) simply update the context URL and do not change the page transition type.
Additionally, NavigationManagerImpl::CreateNavigationItem in ios/web/navigation/navigation_manager_impl.mm prevents certain internal rewrites from turning a reload of a non-app-specific URL into an app-specific load, but it does not apply to explicit server redirects that directly target an app-specific URL:
std::unique_ptr<NavigationItemImpl> NavigationManagerImpl::CreateNavigationItem(
const GURL& url,
const web::Referrer& referrer,
ui::PageTransition transition,
web::NavigationInitiationType initiation_type,
web::HttpsUpgradeType https_upgrade_type,
const GURL& previous_url,
const std::vector<BrowserURLRewriter::URLRewriter>* additional_rewriters)
const {
GURL loaded_url(url);
// ... URL rewriter logic ...
// The URL should not be changed to app-specific URL if the load is
// renderer-initiated or a reload requested by non-app-specific URL.
if ((initiation_type == web::NavigationInitiationType::RENDERER_INITIATED ||
PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_RELOAD)) &&
loaded_url != url && web::GetWebClient()->IsAppSpecificURL(loaded_url) &&
!web::GetWebClient()->IsAppSpecificURL(previous_url)) {
loaded_url = url;
}
// ...
}
Putting these pieces together:
- A main-frame reload is represented as
PAGE_TRANSITION_RELOAD, and this information is carried in theNavigationContext. - A server redirect that happens during that reload does not change the transition type, but updates the URL to the redirect target.
- When the redirect target is an app-specific URL (for example
chrome://flags/),IsAppSpecificURL(requestURL)is true andshouldAllowAppSpecificURLNavigationActionseesPAGE_TRANSITION_RELOADand allows the navigation even if the last committed page was a regular HTTP(S) site. - As a result, a regular web page can cause a navigation into a privileged internal
chrome://WebUI page as long as the user has triggered a reload.
The provided proof-of-concept server in web/reload_redirect/ios_nav_reload_test_server.py demonstrates this behavior by:
- Serving a normal HTML page at
/ios-nav-reload-teston first visit, and - Issuing a
302redirect tochrome://flags/on subsequent visits after setting a cookie to record that the client has already visited the page once.
When this server is accessed from iOS Chrome and the user manually reloads the test page, the browser successfully follows the redirect into chrome://flags/, confirming that a non-privileged origin can drive navigation into a privileged chrome:// page via a reload-triggered server redirect.
Impact analysis
Who can exploit it
- Any remote web origin that a user visits in iOS Chrome, as long as the site can induce the user to reload the page once (for example via a UI hint).
What they can do
- After the user reloads the attacker-controlled page, the site can cause iOS Chrome to leave the attacker origin and open a privileged
chrome://WebUI page such aschrome://flags/via a server-side redirect. - This lets untrusted web content reliably drive navigation into internal configuration UIs that are normally intended to be reached only from trusted entry points (e.g. browser UI, bookmarks, or existing WebUI pages).
The cause
What version of Chrome have you found the security issue in?
145.0.7632.1/stable
Is the security issue related to a crash?
No, it is not related to a crash.
Choose the type of vulnerability
Privilege Escalation
How would you like to be publicly acknowledged for your report?
Povcfe of Tencent Security Xuanwu Lab
Context
Chrome on iOS does not use Chromium's own renderer. It embeds Chromium's ios/web navigation stack on top of WKWebView, so the browser's navigation policy is enforced in Objective-C delegate code that sits between WebKit and Chromium's navigation manager. One of the jobs of that layer is to decide whether a navigation to an "app-specific" URL is allowed. In the iOS Chrome configuration, app-specific URLs include internal chrome:// WebUI pages such as chrome://flags/. These pages are meant to be reached from trusted entry points: browser UI, bookmarks, or other WebUI pages, not from arbitrary web content.
The report describes a way for a regular HTTP(S) origin to drive the browser into such a privileged page by combining two ordinary browser behaviours: a user-triggered reload and a server-side redirect.
Setup
The issue was found in Chrome version 145.0.7632.1/stable on iOS. No account, role or special tooling is described. The researcher worked against the Chromium source tree at https://chromium.googlesource.com/chromium/src/ and wrote a small proof-of-concept server, web/reload_redirect/ios_nav_reload_test_server.py, to reproduce the behaviour. The only precondition on the victim side is that the user reloads the attacker's page once, for example after a UI hint.
Finding it
The starting point is the navigation delegate class CRWWKNavigationHandler, which contains special handling for app-specific URLs. The decision for whether to allow such a navigation lives in ios/web/navigation/crw_wk_navigation_handler.mm:
- (BOOL)shouldAllowAppSpecificURLNavigationAction:(WKNavigationAction*)action
transition:
(ui::PageTransition)pageTransition {
GURL requestURL = net::GURLWithNSURL(action.request.URL);
DCHECK(web::GetWebClient()->IsAppSpecificURL(requestURL));
web::NavigationItem* lastItem =
self.webStateImpl->GetNavigationManager()->GetLastCommittedItem();
if (lastItem &&
(web::GetWebClient()->IsAppSpecificURL(lastItem->GetVirtualURL()) ||
web::GetWebClient()->IsAppSpecificURL(lastItem->GetURL()))) {
// Last committed page is also app specific and navigation should be
// allowed.
return YES;
}
if (pageTransition & ui::PAGE_TRANSITION_FORWARD_BACK) {
// Allow back-forward navigations.
return YES;
}
if (pageTransition & ui::PAGE_TRANSITION_RELOAD) {
// Allow reload navigations.
return YES;
}
// ... user-typed / bookmark and iframe cases omitted ...
return NO;
}
The first check is reasonable: if the last committed page was itself app-specific, the navigation is allowed. The back-forward and reload checks are the interesting ones. For an app-specific URL, the function unconditionally allows the navigation when the page transition has the PAGE_TRANSITION_RELOAD bit set, even if the last committed page was a regular web origin rather than an internal WebUI. The reload exemption, presumably intended to let a user refresh an internal page, does not verify that the page being reloaded was internal in the first place.
Exploitation
Step 1: understand where the transition value comes from
The function is called from the main navigation policy decision in the same file:
- (void)webView:(WKWebView*)webView
decidePolicyForNavigationAction:(WKNavigationAction*)action
preferences:(WKWebpagePreferences*)preferences
decisionHandler:
(void (^)(WKNavigationActionPolicy,
WKWebpagePreferences*))handler {
// ...
GURL requestURL = net::GURLWithNSURL(action.request.URL);
// ...
ui::PageTransition transition =
[self pageTransitionFromNavigationType:action.navigationType];
if (isMainFrameNavigationAction) {
web::NavigationContextImpl* context =
[self contextForPendingMainFrameNavigationWithURL:requestURL];
if (context &&
(!context->IsRendererInitiated() ||
(context->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK))) {
transition = context->GetPageTransition();
if (context->IsLoadingErrorPage()) {
decisionHandler(WKNavigationActionPolicyAllow);
return;
}
}
}
// ...
web::WebStatePolicyDecider::PolicyDecision policyDecision =
web::WebStatePolicyDecider::PolicyDecision::Allow();
if (web::GetWebClient()->IsAppSpecificURL(requestURL)) {
if (![self shouldAllowAppSpecificURLNavigationAction:action
transition:transition]) {
policyDecision = web::WebStatePolicyDecider::PolicyDecision::Cancel();
}
if (policyDecision.ShouldAllowNavigation()) {
[self.delegate navigationHandler:self createWebUIForURL:requestURL];
}
}
// ...
}
For a main-frame navigation with an associated NavigationContext, the transition is taken from the context's GetPageTransition() rather than from WebKit's navigation type. That matters because the context survives across a redirect and keeps the transition of the original navigation.
The fallback mapping from WebKit's navigation type is:
- (ui::PageTransition)pageTransitionFromNavigationType:
(WKNavigationType)navigationType {
switch (navigationType) {
case WKNavigationTypeLinkActivated:
return ui::PAGE_TRANSITION_LINK;
case WKNavigationTypeFormSubmitted:
case WKNavigationTypeFormResubmitted:
return ui::PAGE_TRANSITION_FORM_SUBMIT;
case WKNavigationTypeBackForward:
return ui::PAGE_TRANSITION_FORWARD_BACK;
case WKNavigationTypeReload:
return ui::PAGE_TRANSITION_RELOAD;
case WKNavigationTypeOther:
// ... heuristic for "Other" ...
}
}
A user-triggered reload therefore produces PAGE_TRANSITION_RELOAD, and that value is carried in the NavigationContext for the main frame.
Step 2: check what a server redirect does to the transition
Server-side redirects are handled in didReceiveServerRedirectForProvisionalNavigation:
- (void)webView:(WKWebView*)webView
didReceiveServerRedirectForProvisionalNavigation:(WKNavigation*)navigation {
// ...
GURL webViewURL = net::GURLWithNSURL(webView.URL);
web::NavigationContextImpl* context =
[self.navigationStates contextForNavigation:navigation];
if (!context) {
return;
}
// Redirecting to a data url is always unsafe.
if (webViewURL.SchemeIs(url::kDataScheme) ||
// Block redirects to JavaScript schemes.
webViewURL.SchemeIs(url::kJavaScriptScheme)) {
self.pendingNavigationInfo.unsafeRedirect = YES;
} else {
context->SetUrl(webViewURL);
}
// ...
}
Redirects to data: and javascript: are treated as unsafe. Redirects to any other scheme, including chrome://, simply update the context URL through SetUrl and do not change the page transition type. The reload bit set in step 1 is still there when the policy decision runs for the redirect target.
Step 3: check the navigation manager's guard
There is a second defence in NavigationManagerImpl::CreateNavigationItem in ios/web/navigation/navigation_manager_impl.mm, which prevents certain internal rewrites from turning a reload of a non-app-specific URL into an app-specific load:
std::unique_ptr<NavigationItemImpl> NavigationManagerImpl::CreateNavigationItem(
const GURL& url,
const web::Referrer& referrer,
ui::PageTransition transition,
web::NavigationInitiationType initiation_type,
web::HttpsUpgradeType https_upgrade_type,
const GURL& previous_url,
const std::vector<BrowserURLRewriter::URLRewriter>* additional_rewriters)
const {
GURL loaded_url(url);
// ... URL rewriter logic ...
// The URL should not be changed to app-specific URL if the load is
// renderer-initiated or a reload requested by non-app-specific URL.
if ((initiation_type == web::NavigationInitiationType::RENDERER_INITIATED ||
PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_RELOAD)) &&
loaded_url != url && web::GetWebClient()->IsAppSpecificURL(loaded_url) &&
!web::GetWebClient()->IsAppSpecificURL(previous_url)) {
loaded_url = url;
}
// ...
}
This guard only fires when the URL rewriter changes the URL (loaded_url != url). It does not apply to explicit server redirects that directly target an app-specific URL, because in that case the URL is not being rewritten by the rewriter at all.
Step 4: put the pieces together
- A main-frame reload is represented as
PAGE_TRANSITION_RELOAD, and this information is carried in theNavigationContext. - A server redirect that happens during that reload does not change the transition type, but updates the URL to the redirect target.
- When the redirect target is an app-specific URL (for example
chrome://flags/),IsAppSpecificURL(requestURL)is true andshouldAllowAppSpecificURLNavigationActionseesPAGE_TRANSITION_RELOADand allows the navigation even if the last committed page was a regular HTTP(S) site. - As a result, a regular web page can cause a navigation into a privileged internal
chrome://WebUI page as long as the user has triggered a reload.
Step 5: reproduce with the test server
The proof-of-concept server in web/reload_redirect/ios_nav_reload_test_server.py demonstrates the behaviour by:
- Serving a normal HTML page at
/ios-nav-reload-teston first visit, and - Issuing a
302redirect tochrome://flags/on subsequent visits after setting a cookie to record that the client has already visited the page once.
When this server is accessed from iOS Chrome and the user manually reloads the test page, the browser successfully follows the redirect into chrome://flags/, confirming that a non-privileged origin can drive navigation into a privileged chrome:// page via a reload-triggered server redirect.
Root cause
The mistake is in shouldAllowAppSpecificURLNavigationAction: the PAGE_TRANSITION_RELOAD branch allows any app-specific navigation whose transition carries the reload bit, without checking that the last committed page was itself app-specific. The earlier check in the same function does look at the last committed item, but only to allow the navigation; it is not used to constrain the reload case.
The redirect handler compounds this. It treats data: and javascript: redirect targets as unsafe, but for every other scheme it only calls context->SetUrl(webViewURL). The transition stored in the context is left untouched, so the reload bit from the original navigation is still present when the policy decision is made for the chrome:// target.
The guard in NavigationManagerImpl::CreateNavigationItem looks like it was written for exactly this class of problem, but its condition requires the URL rewriter to have changed the URL (loaded_url != url). A server redirect that directly targets an app-specific URL never goes through that rewrite path, so the guard does not apply.
Impact
Any remote web origin that a user visits in iOS Chrome can exploit this, as long as the site can induce the user to reload the page once, for example via a UI hint. After the reload, the site can cause iOS Chrome to leave the attacker origin and open a privileged chrome:// WebUI page such as chrome://flags/ via a server-side redirect. This lets untrusted web content reliably drive navigation into internal configuration UIs that are normally intended to be reached only from trusted entry points such as browser UI, bookmarks, or existing WebUI pages.
The report classifies the issue as privilege escalation. It does not describe any further action taken once the internal page is open, so the impact described is the navigation itself into a privileged page.
Fix
The report does not describe the patch that was applied. Based on the root cause, the reload exemption in shouldAllowAppSpecificURLNavigationAction should be conditioned on the last committed page being app-specific, and the redirect handler should not preserve a reload transition when the redirect target is app-specific and the previous page was not. The existing CreateNavigationItem guard would also need to cover explicit server redirects, not only URL rewriter changes.
Variants to test
- Other app-specific schemes and pages on iOS Chrome: try redirecting a reload to other internal WebUI URLs and see whether the navigation is allowed. A positive result is the internal page opening from a regular HTTP(S) origin after a reload.
- Redirect chains: place the app-specific target at the end of a chain of HTTP redirects during a reload. A positive result is the same privileged navigation surviving the chain.
- Other transition types that are exempted in the same function: the back-forward branch is also unconditional. Test whether a history navigation combined with a server redirect can reach an app-specific URL from a non-app-specific page.
- Redirects to
data:andjavascript:: these are explicitly marked unsafe in the redirect handler. Confirm they are still blocked in the same reload scenario, as a control for the test setup. - Other platforms and embedders that share
ios/web: check whether the same reload plus redirect combination reaches app-specific URLs in any other product built on this navigation stack.
What happened, in plain words
Chrome on an iPhone or iPad is not built the same way as Chrome on a desktop computer. On iOS, Apple requires every browser to use Apple's own web engine, called WebKit, through a component named WKWebView. Chrome therefore puts its own code on top of WKWebView: a layer called ios/web that handles navigation, meaning the act of moving from one page to another. This layer decides whether a navigation is allowed or must be cancelled.
Some addresses inside Chrome are not ordinary websites. They start with chrome:// and open built-in pages, called WebUI pages, that belong to the browser itself. One example is chrome://flags/, a page where you can switch experimental features on and off. These pages are meant to be opened only from trusted places: the browser's own menus, bookmarks, or other internal pages. A random website should not be able to send you there.
The report shows that a normal website can, in fact, send iOS Chrome to such an internal page. It does this by combining two very ordinary things: you pressing the reload button, and the website's server answering with a redirect (an instruction that says "go to this other address instead"). The researcher found this in Chrome version 145.0.7632.1/stable on iOS, wrote a small test server to prove it, and classified the issue as a privilege escalation. A privilege escalation means moving from a place with few rights (a normal web page) to a place with more rights (an internal browser page).
Background you need first
A few ideas come up again and again, so here they are from zero.
- Browser engine: the part of a browser that downloads a page, reads its HTML, and draws it. On iOS, Apple only allows its own engine, WebKit.
WKWebView: Apple's component that lets an app show web content inside itself. Chrome on iOS uses it to display pages.- Navigation: any move from one page to another, whether you clicked a link, typed an address, pressed back, or pressed reload.
- Navigation delegate: a piece of code that the app registers with
WKWebViewto be asked "may this navigation happen?" before it does. Think of a doorman who checks every person entering a building. - App-specific URL: an address that belongs to the app itself rather than to the public web. In iOS Chrome these include
chrome://pages such aschrome://flags/. - WebUI: Chrome's name for its own built-in pages, written with web technology but running with the browser's trust.
- Page transition: a label attached to a navigation saying how it started: a clicked link, a submitted form, a back or forward move, a reload, and so on. The browser uses this label to apply different rules to different kinds of navigation.
- Server-side redirect: when the server answers a request not with a page but with an instruction to fetch a different address. The browser then automatically requests that second address. A
302is the common status code for a temporary redirect. - Cookie: a small piece of data a website asks the browser to store and send back on later visits. It lets the server recognise that this browser has been here before.
- Proof of concept (PoC): a small, deliberately simple program that demonstrates a bug really works, without doing anything harmful.
Context
Chrome on iOS does not use Chromium's own renderer, the part of Chromium that turns HTML into pixels. It embeds Chromium's ios/web navigation stack on top of WKWebView. So the browser's navigation policy, the rules about which navigations are allowed, is enforced in Objective-C delegate code that sits between WebKit and Chromium's navigation manager. Objective-C is the programming language used for this Apple-side code.
One of the jobs of that layer is to decide whether a navigation to an app-specific URL is allowed. In the iOS Chrome configuration, app-specific URLs include internal chrome:// WebUI pages such as chrome://flags/. These pages are meant to be reached from trusted entry points: browser UI, bookmarks, or other WebUI pages, not from arbitrary web content.
The report describes a way for a regular HTTP(S) origin, meaning an ordinary website served over http or https, to drive the browser into such a privileged page by combining two ordinary browser behaviours: a user-triggered reload and a server-side redirect.
Setup
The issue was found in Chrome version 145.0.7632.1/stable on iOS. No account, role or special tooling is described. The researcher worked against the Chromium source tree at https://chromium.googlesource.com/chromium/src/ and wrote a small proof-of-concept server, web/reload_redirect/ios_nav_reload_test_server.py, to reproduce the behaviour. The only precondition on the victim side is that the user reloads the attacker's page once, for example after a UI hint.
In plain terms: the researcher read Chrome's source code (the human-written instructions that make up the browser), spotted a rule that looked too permissive, and then built a tiny website to check whether the rule really could be abused on a real iPhone.
Finding it
The starting point is the navigation delegate class CRWWKNavigationHandler, which contains special handling for app-specific URLs. A class here is just a bundle of related code. The decision for whether to allow such a navigation lives in ios/web/navigation/crw_wk_navigation_handler.mm:
- (BOOL)shouldAllowAppSpecificURLNavigationAction:(WKNavigationAction*)action
transition:
(ui::PageTransition)pageTransition {
GURL requestURL = net::GURLWithNSURL(action.request.URL);
DCHECK(web::GetWebClient()->IsAppSpecificURL(requestURL));
web::NavigationItem* lastItem =
self.webStateImpl->GetNavigationManager()->GetLastCommittedItem();
if (lastItem &&
(web::GetWebClient()->IsAppSpecificURL(lastItem->GetVirtualURL()) ||
web::GetWebClient()->IsAppSpecificURL(lastItem->GetURL()))) {
// Last committed page is also app specific and navigation should be
// allowed.
return YES;
}
if (pageTransition & ui::PAGE_TRANSITION_FORWARD_BACK) {
// Allow back-forward navigations.
return YES;
}
if (pageTransition & ui::PAGE_TRANSITION_RELOAD) {
// Allow reload navigations.
return YES;
}
// ... user-typed / bookmark and iframe cases omitted ...
return NO;
}
Line by line:
- The function is named
shouldAllowAppSpecificURLNavigationActionand returnsBOOL, an Objective-C yes/no value. It receives the navigationactionand apageTransitionlabel. GURL requestURL = net::GURLWithNSURL(action.request.URL);converts the address WebKit is asking about into Chromium's own URL type,GURL.DCHECK(...)is a debug-only assertion: in debug builds it crashes if the address is not app-specific, which documents the assumption that this function is only called for such addresses.GetLastCommittedItem()fetches the page that is currently fully loaded and shown, the "last committed" page.- The first
ifsays: if there is a last committed page and it is itself app-specific, returnYES(allow). This is the sensible case: you are already on an internal page and moving to another one. - The second
ifchecks whether the transition label contains the back-forward bit and, if so, returnsYES. The&is a bitwise AND: it tests whether a particular flag is set inside the label. - The third
ifdoes the same for the reload bit,PAGE_TRANSITION_RELOAD, and returnsYES. - If none of these matched, it returns
NO.
The first check is reasonable: if the last committed page was itself app-specific, the navigation is allowed. The back-forward and reload checks are the interesting ones. For an app-specific URL, the function unconditionally allows the navigation when the page transition has the PAGE_TRANSITION_RELOAD bit set, even if the last committed page was a regular web origin rather than an internal WebUI. The reload exemption, presumably intended to let a user refresh an internal page, does not verify that the page being reloaded was internal in the first place.
An everyday comparison: a guard lets anyone through a door if they say "I am just coming back in" (reload), without checking whether they were ever inside.
Exploitation
Step 1: understand where the transition value comes from
The function is called from the main navigation policy decision in the same file:
- (void)webView:(WKWebView*)webView
decidePolicyForNavigationAction:(WKNavigationAction*)action
preferences:(WKWebpagePreferences*)preferences
decisionHandler:
(void (^)(WKNavigationActionPolicy,
WKWebpagePreferences*))handler {
// ...
GURL requestURL = net::GURLWithNSURL(action.request.URL);
// ...
ui::PageTransition transition =
[self pageTransitionFromNavigationType:action.navigationType];
if (isMainFrameNavigationAction) {
web::NavigationContextImpl* context =
[self contextForPendingMainFrameNavigationWithURL:requestURL];
if (context &&
(!context->IsRendererInitiated() ||
(context->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK))) {
transition = context->GetPageTransition();
if (context->IsLoadingErrorPage()) {
decisionHandler(WKNavigationActionPolicyAllow);
return;
}
}
}
// ...
web::WebStatePolicyDecider::PolicyDecision policyDecision =
web::WebStatePolicyDecider::PolicyDecision::Allow();
if (web::GetWebClient()->IsAppSpecificURL(requestURL)) {
if (![self shouldAllowAppSpecificURLNavigationAction:action
transition:transition]) {
policyDecision = web::WebStatePolicyDecider::PolicyDecision::Cancel();
}
if (policyDecision.ShouldAllowNavigation()) {
[self.delegate navigationHandler:self createWebUIForURL:requestURL];
}
}
// ...
}
Line by line:
- This is WebKit's callback
decidePolicyForNavigationAction. WebKit calls it before starting a navigation and expects the app to answer throughdecisionHandler. requestURLis the address being navigated to, converted toGURL.transitionis first guessed from WebKit's own navigation type by callingpageTransitionFromNavigationType.isMainFrameNavigationActiontells whether this navigation targets the main page area rather than a small embedded frame (an iframe).- If it is the main frame, the code looks up a
NavigationContextfor this navigation. A context is a small record the browser keeps about a navigation in progress; it survives across redirects. - The inner
ifreplaces the guessed transition with the one stored in the context, provided the navigation was not started by the page's own code (renderer-initiated) or it is a back-forward move. This matters because the context keeps the transition of the original navigation. - If the context says an error page is loading, the navigation is allowed immediately and the function returns.
policyDecisionstarts asAllow().- If the target address is app-specific, the code calls
shouldAllowAppSpecificURLNavigationAction; if that returns no, the decision becomesCancel(). - If the decision still allows the navigation,
createWebUIForURLis called to set up the internal page.
For a main-frame navigation with an associated NavigationContext, the transition is taken from the context's GetPageTransition() rather than from WebKit's navigation type. That matters because the context survives across a redirect and keeps the transition of the original navigation.
The fallback mapping from WebKit's navigation type is:
- (ui::PageTransition)pageTransitionFromNavigationType:
(WKNavigationType)navigationType {
switch (navigationType) {
case WKNavigationTypeLinkActivated:
return ui::PAGE_TRANSITION_LINK;
case WKNavigationTypeFormSubmitted:
case WKNavigationTypeFormResubmitted:
return ui::PAGE_TRANSITION_FORM_SUBMIT;
case WKNavigationTypeBackForward:
return ui::PAGE_TRANSITION_FORWARD_BACK;
case WKNavigationTypeReload:
return ui::PAGE_TRANSITION_RELOAD;
case WKNavigationTypeOther:
// ... heuristic for "Other" ...
}
}
Line by line:
- The function takes WebKit's navigation type and returns Chromium's transition label.
- A clicked link becomes
PAGE_TRANSITION_LINK. - A submitted or resubmitted form becomes
PAGE_TRANSITION_FORM_SUBMIT. - A back or forward move becomes
PAGE_TRANSITION_FORWARD_BACK. - A reload becomes
PAGE_TRANSITION_RELOAD. - Anything else falls into a heuristic, a best guess, which the report does not spell out.
A user-triggered reload therefore produces PAGE_TRANSITION_RELOAD, and that value is carried in the NavigationContext for the main frame.
Step 2: check what a server redirect does to the transition
Server-side redirects are handled in didReceiveServerRedirectForProvisionalNavigation:
- (void)webView:(WKWebView*)webView
didReceiveServerRedirectForProvisionalNavigation:(WKNavigation*)navigation {
// ...
GURL webViewURL = net::GURLWithNSURL(webView.URL);
web::NavigationContextImpl* context =
[self.navigationStates contextForNavigation:navigation];
if (!context) {
return;
}
// Redirecting to a data url is always unsafe.
if (webViewURL.SchemeIs(url::kDataScheme) ||
// Block redirects to JavaScript schemes.
webViewURL.SchemeIs(url::kJavaScriptScheme)) {
self.pendingNavigationInfo.unsafeRedirect = YES;
} else {
context->SetUrl(webViewURL);
}
// ...
}
Line by line:
- This is WebKit's callback telling the app that a server redirect arrived while the navigation was still provisional, meaning not yet finished.
webViewURLis the address the redirect points to.- The code looks up the
NavigationContextfor this navigation. - If there is no context, it gives up and returns.
- If the redirect target uses the
data:scheme (an address that carries its content inline) or thejavascript:scheme (an address that runs code), the navigation is flagged as an unsafe redirect. - Otherwise,
context->SetUrl(webViewURL)simply updates the context's address to the redirect target.
Redirects to data: and javascript: are treated as unsafe. Redirects to any other scheme, including chrome://, simply update the context URL through SetUrl and do not change the page transition type. The reload bit set in step 1 is still there when the policy decision runs for the redirect target.
Step 3: check the navigation manager's guard
There is a second defence in NavigationManagerImpl::CreateNavigationItem in ios/web/navigation/navigation_manager_impl.mm, which prevents certain internal rewrites from turning a reload of a non-app-specific URL into an app-specific load:
std::unique_ptr<NavigationItemImpl> NavigationManagerImpl::CreateNavigationItem(
const GURL& url,
const web::Referrer& referrer,
ui::PageTransition transition,
web::NavigationInitiationType initiation_type,
web::HttpsUpgradeType https_upgrade_type,
const GURL& previous_url,
const std::vector<BrowserURLRewriter::URLRewriter>* additional_rewriters)
const {
GURL loaded_url(url);
// ... URL rewriter logic ...
// The URL should not be changed to app-specific URL if the load is
// renderer-initiated or a reload requested by non-app-specific URL.
if ((initiation_type == web::NavigationInitiationType::RENDERER_INITIATED ||
PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_RELOAD)) &&
loaded_url != url && web::GetWebClient()->IsAppSpecificURL(loaded_url) &&
!web::GetWebClient()->IsAppSpecificURL(previous_url)) {
loaded_url = url;
}
// ...
}
Line by line:
- This function creates a navigation item, the record of one navigation in the browser's history.
- It receives the target
url, areferrer(the page that linked here), thetransitionlabel, aninitiation_type(who started it), an HTTPS upgrade type, theprevious_url, and optional URL rewriters. - A URL rewriter is a rule that silently changes an address before loading, for example turning a typed address into a search.
loaded_urlstarts as the requestedurland may be changed by the rewriter logic.- The
ifis the guard. It fires only when the navigation was started by the page's own code, or it is a reload, and the rewriter changed the address (loaded_url != url), and the new address is app-specific while the previous one was not. - When all of that is true,
loaded_url = urlputs the original address back, blocking the silent switch to an internal page.
This guard only fires when the URL rewriter changes the URL (loaded_url != url). It does not apply to explicit server redirects that directly target an app-specific URL, because in that case the URL is not being rewritten by the rewriter at all.
Step 4: put the pieces together
- A main-frame reload is represented as
PAGE_TRANSITION_RELOAD, and this information is carried in theNavigationContext. - A server redirect that happens during that reload does not change the transition type, but updates the URL to the redirect target.
- When the redirect target is an app-specific URL (for example
chrome://flags/),IsAppSpecificURL(requestURL)is true andshouldAllowAppSpecificURLNavigationActionseesPAGE_TRANSITION_RELOADand allows the navigation even if the last committed page was a regular HTTP(S) site. - As a result, a regular web page can cause a navigation into a privileged internal
chrome://WebUI page as long as the user has triggered a reload.
Step 5: reproduce with the test server
The proof-of-concept server in web/reload_redirect/ios_nav_reload_test_server.py demonstrates the behaviour by:
- Serving a normal HTML page at
/ios-nav-reload-teston first visit, and - Issuing a
302redirect tochrome://flags/on subsequent visits after setting a cookie to record that the client has already visited the page once.
When this server is accessed from iOS Chrome and the user manually reloads the test page, the browser successfully follows the redirect into chrome://flags/, confirming that a non-privileged origin can drive navigation into a privileged chrome:// page via a reload-triggered server redirect.
Why the test is built this way: the first visit must look completely normal, so the browser records an ordinary page with an ordinary transition. The cookie is the server's memory of that first visit. On the reload, the server recognises the cookie and answers with the redirect instead of the page. Because the reload label is still attached to the navigation, the internal page is allowed.
Root cause
The mistake is in shouldAllowAppSpecificURLNavigationAction: the PAGE_TRANSITION_RELOAD branch allows any app-specific navigation whose transition carries the reload bit, without checking that the last committed page was itself app-specific. The earlier check in the same function does look at the last committed item, but only to allow the navigation; it is not used to constrain the reload case.
The redirect handler compounds this. It treats data: and javascript: redirect targets as unsafe, but for every other scheme it only calls context->SetUrl(webViewURL). The transition stored in the context is left untouched, so the reload bit from the original navigation is still present when the policy decision is made for the chrome:// target.
The guard in NavigationManagerImpl::CreateNavigationItem looks like it was written for exactly this class of problem, but its condition requires the URL rewriter to have changed the URL (loaded_url != url). A server redirect that directly targets an app-specific URL never goes through that rewrite path, so the guard does not apply.
Impact
Any remote web origin that a user visits in iOS Chrome can exploit this, as long as the site can induce the user to reload the page once, for example via a UI hint. After the reload, the site can cause iOS Chrome to leave the attacker origin and open a privileged chrome:// WebUI page such as chrome://flags/ via a server-side redirect. This lets untrusted web content reliably drive navigation into internal configuration UIs that are normally intended to be reached only from trusted entry points such as browser UI, bookmarks, or existing WebUI pages.
The report classifies the issue as privilege escalation. It does not describe any further action taken once the internal page is open, so the impact described is the navigation itself into a privileged page.
Fix
The report does not describe the patch that was applied. Based on the root cause, the reload exemption in shouldAllowAppSpecificURLNavigationAction should be conditioned on the last committed page being app-specific, and the redirect handler should not preserve a reload transition when the redirect target is app-specific and the previous page was not. The existing CreateNavigationItem guard would also need to cover explicit server redirects, not only URL rewriter changes.
Variants to test
- Other app-specific schemes and pages on iOS Chrome: try redirecting a reload to other internal WebUI URLs and see whether the navigation is allowed. A positive result is the internal page opening from a regular HTTP(S) origin after a reload.
- Redirect chains: place the app-specific target at the end of a chain of HTTP redirects during a reload. A positive result is the same privileged navigation surviving the chain.
- Other transition types that are exempted in the same function: the back-forward branch is also unconditional. Test whether a history navigation combined with a server redirect can reach an app-specific URL from a non-app-specific page.
- Redirects to
data:andjavascript:: these are explicitly marked unsafe in the redirect handler. Confirm they are still blocked in the same reload scenario, as a control for the test setup. - Other platforms and embedders that share
ios/web: check whether the same reload plus redirect combination reaches app-specific URLs in any other product built on this navigation stack.
Glossary
- App-specific URL: an address that belongs to the browser app itself rather than to the public web, such as
chrome://flags/in iOS Chrome. - Bitwise AND (
&): an operation that compares the individual bits of two values; used here to test whether a particular flag is set inside a transition label. - Class: a bundle of related code and data in object-oriented programming.
- Cookie: a small piece of data a website asks the browser to store and send back on later visits, letting the server recognise the browser.
data:scheme: an address that carries its content inline instead of pointing to a server.- Debug assertion (
DCHECK): a check that only runs in debug builds and crashes if an assumption is violated. - Delegate: a piece of code an app registers so that another component can call it back for decisions or events.
GURL: Chromium's own type for representing a URL.- HTTP(S) origin: an ordinary website served over http or https.
- iframe: a small web page embedded inside another page.
javascript:scheme: an address that runs code instead of loading a page.- Main frame: the main page area of a browser tab, as opposed to an embedded iframe.
- Navigation: any move from one page to another, by link, address, back, forward or reload.
- Navigation context: a small record the browser keeps about a navigation in progress; it survives across redirects.
- Navigation delegate: the code that is asked whether a navigation may proceed before it happens.
- Navigation item: the record of one navigation in the browser's history.
- Objective-C: the programming language used for Apple-side code in this report.
- Page transition: a label attached to a navigation saying how it started, such as link, form submit, back-forward or reload.
- Privilege escalation: moving from a place with few rights to one with more rights, here from a normal web page to an internal browser page.
- Proof of concept (PoC): a small, deliberately simple program that demonstrates a bug really works.
- Redirect: a server's instruction to fetch a different address instead;
302is the common status code for a temporary one. - Renderer-initiated: a navigation started by the page's own code rather than by the user or the browser.
- Scheme: the first part of an address, such as
http,https,chrome,dataorjavascript, which says how to interpret it. - URL rewriter: a rule that silently changes an address before loading it.
- WebKit: Apple's browser engine, which every browser on iOS must use.
WKWebView: Apple's component that lets an app display web content inside itself.