Insufficient validation of untrusted input in Payments (CVE-2026-17747)
A compromised renderer hosting a service worker can send a message to open a payment handler window, and on Android the fallback path loses the caller's identity and attaches the attacker's URL to the active payment flow. This could let the attacker display a phishing page in the Payment Handler BottomSheet instead of the legitimate payment app.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 months
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 security team.
Overview: A compromised renderer hosting any service worker can potentially hijack an active Payment Handler BottomSheet on Android to display an attacker-controlled page. This occurs because the fallback mechanism for opening payment handler windows on Android loses the caller's identity and blindly attaches the requested URL to a process-wide static singleton representing the active payment flow.
Affected files:
components/payments/content/android/java/src/org/chromium/components/payments/PaymentRequestService.javacontent/browser/service_worker/service_worker_version.ccchrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.javachrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java
Estimated timestamp from git blame: 2025-04-22
Description
On Android, a security vulnerability exists where a compromised renderer can inject an attacker-controlled page into the Payment Handler BottomSheet for an unrelated, in-progress payment flow. This is a confused-deputy issue resulting from a lack of caller authorization checks and the loss of context during a C++ to Java JNI transition.
Root Cause
The vulnerability stems from a sequence of gaps in validation and routing:
-
Missing Authorization Check in C++: When a renderer sends the
blink::mojom::ServiceWorkerHost::OpenPaymentHandlerWindowMojo message,ServiceWorkerVersion::OpenPaymentHandlerWindow(service_worker_version.cc) only validates that the requested URL is same-origin with the calling Service Worker. Crucially, it does not verify if the calling Service Worker is actually authorized to interact with the current payment flow (e.g., by checking if it has a pendingPaymentRequestEvent). -
Android Fallback and Identity Loss:
PaymentHandlerSupport::ShowPaymentHandlerWindowattempts to callChromeContentBrowserClient::ShowPaymentHandlerWindow. On Android, this method explicitly returnsfalse. This triggers a fallback mechanism inShowPaymentHandlerWindowReplier::~ShowPaymentHandlerWindowReplier, which routes the request toServiceWorkerVersion::OpenWindowwith aNEW_POPUPdisposition. This request is eventually routed to JNI viaServiceTabLauncher::LaunchTab. During this transition, the identity of the calling Service Worker is lost. -
Blind Dispatch in Java: In Java,
ServiceTabLauncher.launchTabreceives theNEW_POPUPrequest and blindly calls the static methodPaymentRequestService.openPaymentHandlerWindow(url). -
Process-Global Singleton Hijack:
PaymentRequestService.openPaymentHandlerWindow(url)retrieves the currently active payment flow from a process-wide static singleton (BrowserGlobalPaymentFlowManager.sShowingPaymentRequest). It then attaches the attacker-providedurlto this active flow without verifying that the URL's origin matches the origin of the legitimately invoked payment app (mInvokedPaymentApp).
Potential Attack Scenario
Note: These are suggested steps; our tooling agent does not yet have the ability to run code.
- An attacker compromises a renderer process (e.g., via a v8 exploit) and controls a Service Worker at
attacker.example. - A victim initiates a legitimate
PaymentRequestonmerchant.exampleand selects a legitimate payment app (e.g.,bank.example). - The browser begins the invocation process, setting
mInvokedPaymentApptobank.exampleand storing the active flow inBrowserGlobalPaymentFlowManager.sShowingPaymentRequest. - The compromised renderer sends the
OpenPaymentHandlerWindowMojo IPC with the URLhttps://attacker.example/phish. - The browser process validates the URL is same-origin with the attacker's Service Worker and routes the request through the Android fallback mechanism.
ServiceTabLaunchercallsPaymentRequestService.openPaymentHandlerWindow, which attaches the attacker's phishing URL to the victim's active payment flow.- The Payment Handler BottomSheet opens, displaying the attacker's phishing page instead of the intended
bank.exampleinterface.
Because sShowingPaymentRequest is process-wide, this could potentially allow an attacker in a regular profile to hijack a payment flow in an Incognito profile if they occur concurrently.
(Note: Exploitation requires a timing constraint to ensure the Mojo IPC arrives after mInvokedPaymentApp is set, otherwise a Java NullPointerException occurs due to an assert in PaymentRequestService.java:648.)
Suggested Fix
- C++ Validation: In
ServiceWorkerVersion::OpenPaymentHandlerWindow(or at thePaymentRequestEventdispatch level), verify that the calling Service Worker actually has a pendingPaymentRequestEventand is the currently authorized handler for an active payment request before proceeding. - Java Validation: In
PaymentRequestService.openPaymentHandlerWindow, add a strict check to ensure that the origin of the providedurlmatches the origin (or scope) ofmInvokedPaymentAppbefore opening the window.
Evaluated with Chrome root at commit: 137d451a126685dd5010e6609db9f6d4a78d8234
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
Likely the code only checks that the requested URL is same-origin with the calling service worker, but does not verify that the service worker is authorised to interact with the current payment flow, and the Android fallback loses the caller's identity before attaching the URL to a process-wide singleton.
Impact
The Payment Handler BottomSheet could display the attacker's phishing page instead of the intended bank interface, and because the singleton is process-wide, an attacker in a regular profile could potentially hijack a concurrent payment flow in an Incognito profile; exploitation requires a timing constraint to avoid a null pointer exception.
What the attacker needed
Compromised renderer process; victim initiates a payment request; timing constraint for the IPC
The fix
The fix should add a check in C++ that the calling service worker has a pending PaymentRequestEvent and is the authorised handler, and a check in Java that the URL's origin matches the invoked payment app's origin.
How it was found
- An attacker compromises a renderer process and controls a service worker at attacker.example.
- A victim initiates a legitimate PaymentRequest on merchant.example and selects a legitimate payment app such as bank.example.
- The browser sets mInvokedPaymentApp to bank.example and stores the active flow in BrowserGlobalPaymentFlowManager.sShowingPaymentRequest.
- The compromised renderer sends the OpenPaymentHandlerWindow Mojo IPC with the URL https://attacker.example/phish.
- The browser validates the URL is same-origin with the attacker's service worker and routes the request through the Android fallback mechanism.
- ServiceTabLauncher calls PaymentRequestService.openPaymentHandlerWindow, which attaches the attacker's phishing URL to the victim's active payment flow.
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 service worker is a script that runs in the background for a website. The payment handler is the pop-up that shows your bank's payment interface. The bug means a malicious service worker could make that pop-up show the attacker's page instead of your bank's, which could trick you into entering payment details.
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.