Insufficient validation of untrusted input in WebView (CVE-2026-13924)
AwProxyingRestrictedCookieManager trusted the renderer-supplied site_for_cookies parameter when enforcing WebView's third-party cookie policy. A compromised renderer could spoof this value to bypass setAcceptThirdPartyCookies(false) and SameSite cookie protections, allowing cross-site tracking and reading or writing SameSite cookies.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 52 days
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: AwProxyingRestrictedCookieManager incorrectly trusts the renderer-supplied site_for_cookies parameter to enforce WebView's third-party cookie policy. A compromised renderer can spoof this parameter to bypass setAcceptThirdPartyCookies(false) and additionally bypass SameSite cookie protections.
Affected files:
android_webview/browser/network_service/aw_proxying_restricted_cookie_manager.ccandroid_webview/browser/aw_content_browser_client.ccandroid_webview/browser/aw_cookie_access_policy.ccservices/network/restricted_cookie_manager.cc
Estimated timestamp from git blame: 2026-04-13
Description
In Android WebView, AwProxyingRestrictedCookieManager (running in the browser process) acts as a proxy for RestrictedCookieManager (running in the network process). Its purpose is to enforce WebView-specific cookie policies, primarily the per-WebView setAcceptThirdPartyCookies() API, as the network service itself is not globally configured to block third-party cookies for WebView.
However, AwProxyingRestrictedCookieManager incorrectly trusts renderer-supplied Mojo parameters, specifically site_for_cookies, when determining if a request should be treated as first-party or third-party. When a renderer invokes Mojo methods such as GetAllForUrl, SetCanonicalCookie, or GetCookiesString, it provides its own site_for_cookies value. The proxy passes this value to AllowCookies(), which consults AwCookieAccessPolicy::CanAccessCookies() to decide whether the access should be allowed or if third-party cookies should be disabled.
A compromised renderer running in a third-party context (e.g., https://tracker.example embedded within https://victim.example) can spoof site_for_cookies to match its own requested url. This causes the proxy's IsFirstParty() check to evaluate to true, tricking the proxy into treating the request as first-party. The proxy then forwards the request to the underlying RestrictedCookieManager in the network process with disable_3pcs = false (or force_disable_third_party_cookies = false).
While the network process's RestrictedCookieManager::ValidateAccessToCookiesAt detects that the renderer-supplied site_for_cookies does not match the securely bound IsolationInfo, it currently only logs an ERROR and proceeds with the request as long as the URL matches the bound origin (due to a known issue tracked in crbug.com/402207912).
Consequently, the network service processes the request using the attacker's spoofed site_for_cookies. This not only bypasses the WebView-specific third-party cookie block but also incorrectly calculates the SameSite context in MakeOptionsForGet/MakeOptionsForSet. By making the spoofed site_for_cookies match the URL, the network service evaluates the context as SAME_SITE_STRICT, allowing the cross-site attacker to read and write SameSite=Lax and SameSite=Strict cookies.
Impact
This vulnerability allows a compromised renderer to:
- Bypass the
setAcceptThirdPartyCookies(false)policy configured by the Android application developer, enabling cross-site tracking. - Bypass
SameSitecookie protections, allowing a compromised third-party frame to read and writeSameSite=LaxandSameSite=Strictcookies for its own origin.
Potential Exploitation Steps
Note: These are suggested steps based on static analysis.
- An Android application configures a WebView and calls
CookieManager.setAcceptThirdPartyCookies(webview, false). - The WebView loads
https://victim.example, which embeds a third-party iframe tohttps://tracker.example. - An attacker achieves Remote Code Execution (RCE) in the sandboxed renderer process for the
tracker.exampleiframe. - From the compromised renderer, the attacker crafts a Mojo IPC to
RestrictedCookieManager::GetCookiesString. - The attacker sets
url=https://tracker.exampleand spoofssite_for_cookies=https://tracker.example. - The browser process proxy (
AwProxyingRestrictedCookieManager) evaluates the spoofedsite_for_cookies, determines it is a first-party request, and passesdisable_3pcs = falseto the network service. - The network service logs an error about the
site_for_cookiesmismatch but continues execution. It uses the spoofed value to compute aSAME_SITE_STRICTcontext. - The network service returns the cookies for
tracker.example(including SameSite cookies), successfully bypassing both the third-party cookie block and SameSite restrictions.
Suggested Fix
- Proxy Enforcement:
AwProxyingRestrictedCookieManagershould not trust thesite_for_cookiesparameter provided by the renderer over Mojo.AwContentBrowserClient::WillCreateRestrictedCookieManagerreceives the trustedIsolationInfo. It should pass the trustedsite_for_cookiesfrom theIsolationInfoto the constructor ofAwProxyingRestrictedCookieManager, and the proxy should use this trusted value for all policy evaluations instead of the renderer-supplied arguments. - Network Service Enforcement: Address the TODO in
RestrictedCookieManager::ValidateAccessToCookiesAt(crbug.com/402207912) to returnfalseand trigger aReportBadMessagewhen the renderer'ssite_for_cookiesdoes not match theBoundSiteForCookies(), rather than just logging an error.
Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The browser-process proxy trusted the renderer-supplied site_for_cookies parameter instead of using the securely bound IsolationInfo, and the network service only logged a mismatch rather than rejecting it.
Impact
A compromised renderer could bypass the app's third-party cookie policy and SameSite protections, enabling cross-site tracking and unauthorised reading or writing of SameSite cookies.
What the attacker needed
Android app uses WebView with third-party cookies disabled; Attacker compromises the renderer process; Victim loads a page with a third-party iframe
The fix
The proxy should use the trusted site_for_cookies from IsolationInfo instead of the renderer-supplied value, and the network service should reject mismatches with ReportBadMessage rather than only logging an error.
How it was found
- An Android app configures a WebView and disables third-party cookies.
- The WebView loads a page that embeds a third-party iframe.
- The attacker compromises the renderer process for that iframe.
- The attacker sends a crafted IPC request to the cookie manager with a spoofed site_for_cookies value.
- The browser proxy treats the request as first-party and forwards it with third-party cookie blocking disabled.
- The network service logs a mismatch but returns the cookies, including SameSite cookies.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A WebView is a browser window inside an Android app. The app can tell it not to accept cookies from other websites, but the code that checks this trusted a value supplied by the web page's rendering process. If an attacker can take over that process, they can lie about which site they are, so the check passes and cookies that should be blocked are allowed.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.