Intent to Deprecate and Remove: PaymentInstruments

123 views
Skip to first unread message

Rouslan Solomakhin

unread,
Sep 14, 2022, 11:05:17 AM9/14/22
to blink-dev, Stephen Mcgruer

Contact emails

rou...@chromium.orgsmcg...@chromium.org


Summary

PaymentInstruments is the Web API that backs non-JIT install of payment apps (see https://w3c.github.io/payment-handler/). It was designed with the assumption that the browser would store the actual payment instrument details, which has not turned out to be true, and has some privacy leaks. It also has not shipped on any other browser, not have we seen any interest from other browser vendors. As such, we are interested in deprecating and removing the API.


Blink component

Blink>Payments

Motivation

The PaymentInstruments.set() method allows an attacker website to store arbitrary data, which can later be retrieved via PaymentInstruments.get() potentially in a third-party context. For example, the user visits https://tracker.example, which generates and stores a UUID for that user via PaymentInstruments.set(key, UUID). Later, the user visits https://site.example, which opens an iframe for https://tracker.example. That iframe calls PaymentInstruments.get(key) and can retrieve the UUID, thus allowing https://tracker.example to know which user it is. Given the lack of uptake in PaymentInstruments.set(), versus the more common JIT-install path, as well as the overly powerful nature of the API, we propose to remove PaymentInstruments entirely. (PaymentInstruments was designed with the belief that the browser would know about individual payment methods (e.g., credit cards) rather than payment apps, hence the need to store/retrieve arbitrary information.)


TAG review status

Not applicable

Risks

Interoperability and Compatibility

Gecko: Does not implement the Payment Handler API.
WebKit: Does not implement the Payment Handler API.
Web developers: No signals

Other signals:  Metrics of API usage show little to no uptake (< 0.00010 % page loads)

Debuggability

Standard DevTools debugging.


Is this feature fully tested by web-platform-tests?


Requires code in //chrome?

False

Tracking bug

https://crbug.com/1327265

Launch bug

https://crbug.com/1363633

Estimated milestones

Would like to remove in M108.


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5099285054488576

This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Sep 14, 2022, 11:56:04 AM9/14/22
to Rouslan Solomakhin, blink-dev, Stephen Mcgruer
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMMzaWGzus%3DU48U06m-gk7_2G6Wnhn59UJXLi9xW9uz5%2BEWQuA%40mail.gmail.com.

Mike Taylor

unread,
Sep 14, 2022, 12:23:15 PM9/14/22
to Chris Harrelson, Rouslan Solomakhin, blink-dev, Stephen Mcgruer
Hi Rouslan,

Usage is indeed low - do we have any reason to believe there are consumers of this API who have disabled telemetry, i.e. maybe in enterprise contexts? And do we know how these few sites who are using the API... are using the API? Does any real-world usage show up in HTTP Archive?

thanks,
Mike

Rouslan Solomakhin

unread,
Sep 15, 2022, 3:03:21 PM9/15/22
to Mike Taylor, Chris Harrelson, blink-dev, Stephen Mcgruer
Hi Mike,

>  do we have any reason to believe there are consumers of this API who have disabled telemetry, i.e. maybe in enterprise contexts?

We don't have any indications that this could be happening.

> do we know how these few sites who are using the API... are using the API? Does any real-world usage show up in HTTP Archive?

Found 2 websites in HTTP Archive:
  1. A payment app website that also uses a JIT install for payment handlers.
  2. A payment app website that installs a payment handler when you visit their home page, but the code looks more like a demo because of hard-coded strings.
Happy to discuss further.

Cheers,
Rouslan

Yoav Weiss

unread,
Sep 20, 2022, 5:20:24 AM9/20/22
to Rouslan Solomakhin, Mike Taylor, Chris Harrelson, blink-dev, Stephen Mcgruer
On Thu, Sep 15, 2022 at 9:03 PM Rouslan Solomakhin <rou...@chromium.org> wrote:
Hi Mike,

>  do we have any reason to believe there are consumers of this API who have disabled telemetry, i.e. maybe in enterprise contexts?

We don't have any indications that this could be happening.

> do we know how these few sites who are using the API... are using the API? Does any real-world usage show up in HTTP Archive?

Found 2 websites in HTTP Archive:
  1. A payment app website that also uses a JIT install for payment handlers.
  2. A payment app website that installs a payment handler when you visit their home page, but the code looks more like a demo because of hard-coded strings.
Would we expect those uses to break? Are they feature detecting the API before using it?
 

Rouslan Solomakhin

unread,
Sep 20, 2022, 10:26:05 AM9/20/22
to Yoav Weiss, Mike Taylor, Chris Harrelson, blink-dev, Stephen Mcgruer
> Would we expect those uses to break? Are they feature detecting the API before using it?

Partially (for both questions!). In examining the site logic we have found that:

Good news:
  1. These websites will correctly fall back to JIT install of payment handlers in the absence of PaymentInstruments. That does not use the PaymentInstruments API and will continue to work as before.
  2. The websites are feature-detecting the parent PaymentManager interface, registration.paymentManager, which is currently implemented only in Blink.
Bad news:
  1. Once the websites detect the presence of registration.paymentManager, they assume that it has all of the fields present, including registration.paymentManager.instruments. If we remove this instruments field, then there will be some JavaScript errors on these websites. As far as we can tell, these errors are limited in impact and do not affect overall site functionality.

Yoav Weiss

unread,
Sep 21, 2022, 1:42:53 AM9/21/22
to Rouslan Solomakhin, Mike Taylor, Chris Harrelson, blink-dev, Stephen Mcgruer
What did you have in mind in terms of a deprecation timeline? Are you planning to pipe that through CountDeprecation to ensure deprecation reporting?

Rouslan Solomakhin

unread,
Sep 21, 2022, 9:00:21 AM9/21/22
to Yoav Weiss, Mike Taylor, Chris Harrelson, blink-dev, Stephen Mcgruer
Due to the low uptake (< 0.00010 % page loads), we were planning to remove PaymentInstruments API without deprecation reporting, but I am happy to adjust our plans if necessary. What would you recommend?

Stephen Mcgruer

unread,
Sep 21, 2022, 9:10:41 AM9/21/22
to Rouslan Solomakhin, Yoav Weiss, Mike Taylor, Chris Harrelson, blink-dev
(remove in M108, to be clear - just restating from the Chromestatus entry as Yoav asked about the timeline)

Mike Taylor

unread,
Sep 21, 2022, 10:52:41 AM9/21/22
to Stephen Mcgruer, Rouslan Solomakhin, Yoav Weiss, Chris Harrelson, blink-dev
Thanks for all the research Rouslan. The risk seems pretty low (despite the few known instances of breakage - trying to directly contact those sites would be good), but unless there's a compelling reason to remove it ASAP, a few milestones of deprecation reports could surface this to environments where telemetry disabled.

Rouslan Solomakhin

unread,
Sep 21, 2022, 10:59:49 AM9/21/22
to Mike Taylor, Stephen Mcgruer, Yoav Weiss, Chris Harrelson, blink-dev
Sounds like a good plan. In that case, I am requesting to:
  1. Print a deprecation warning in M108 - M110.
  2. Remove in M111.
I will also directly contact the sites that are known to be using the PaymentInstruments API.

Mike Taylor

unread,
Sep 21, 2022, 11:16:00 AM9/21/22
to Rouslan Solomakhin, Stephen Mcgruer, Yoav Weiss, Chris Harrelson, blink-dev
LGTM2, thanks.

Philip Jägenstedt

unread,
Sep 21, 2022, 11:38:48 AM9/21/22
to Mike Taylor, Rouslan Solomakhin, Stephen Mcgruer, Yoav Weiss, Chris Harrelson, blink-dev
LGTM3, seems best to have a deprecation period unless the code is causing trouble.

Reply all
Reply to author
Forward
0 new messages