Intent to deprecate and remove: connect-src CSP bypass in Web Payment API

179 views
Skip to first unread message

Rouslan Solomakhin

unread,
Sep 21, 2022, 1:30:49 PM9/21/22
to blink-dev

Contact emails

smcg...@chromium.orgrou...@chromium.org

Specification

https://www.w3.org/TR/payment-method-manifest/#processing-model

Summary

Deprecate the ability for Web Payment API to bypass the connect-src CSP policy when fetching the manifest. After this deprecation, a site's connect-src CSP policy will need to allow for the payment method URL specified in a PaymentRequest call, as well as any other URLs that the method chains to fetch its manifest.


Blink component

Blink>Payments

Motivation

Content Security Policy (CSP) directives enable a site to detect and mitigate various forms of attacks including Cross-Site Scripting, data injection, and data theft. Specifically, the connect-src[0] directive limits which URLs can be loaded via various script interfaces. Web-based PaymentHandlers are loaded by specifying a URL to the PaymentRequest API, which the browser then uses to fetch a manifest file for the PaymentHandler. This fetching (of various URLs along the way[1]) does not currently obey connect-src within Chrome and so could be used as a data exfiltration method. For example, injected script on https://example.org could specify a (invalid) payment method of https://attacker.com/exfiltrate?data=foobar, where 'foobar' is some secret stolen from example.org. To defeat such an attack, we intend to make PaymentHandler requests fall under the purview of the connect-src CSP policy. This may require action from both PaymentHandler apps and the sites (merchants) that use them. The PaymentHandler app will have to determine all URLs that its app may rely on (e.g., including redirects and the multiple manifest files) and publish this list somewhere. Sites (merchants) using PaymentRequest will have to make sure that if they have a connect-src CSP, it allows for the payment app that they want. [0]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/connect-src [1]: https://www.w3.org/TR/payment-method-manifest/#fetch-pmm



TAG review status

Not applicable

Risks

Interoperability and Compatibility

Gecko: N/A. Does not implement or ship PaymentHandler.
WebKit: N/A. Does not implement or ship PaymentHandler.
Web developers: No signals.
Other signals: No signals.

WebView application risks

None: PaymentHanlders are not supported in WebView.


Debuggability

CSP violations print console error messages.


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

No

Flag name

#web-payment-api-csp

Requires code in //chrome?

False

Tracking bug

https://crbug.com/1349091

Launch bug

https://crbug.com/1349093

Estimated milestones

Print a deprecation warning in developer console: 108-110
Remove CSP bypass: 111
Reverse origin trial if necessary for anyone to opt out: 111-113.

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6286595631087616

Links to previous Intent discussions

Intent to prototype.
Intent to experiment.

This intent message was generated by Chrome Platform Status.

Yoav Weiss

unread,
Sep 22, 2022, 1:47:55 AM9/22/22
to Rouslan Solomakhin, blink-dev
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/CAMMzaWHB8fHC0WB%2BHRNmkQxbpy27v9ziYq-pmUqR9xJvm7Kf2Q%40mail.gmail.com.

mkwst via Chromestatus

unread,
Sep 26, 2022, 3:01:18 AM9/26/22
to blin...@chromium.org
LGTM2.

Rouslan Solomakhin

unread,
Sep 27, 2022, 10:34:30 AM9/27/22
to blink-dev
Hi,

Are there remaining questions for me to answer? (Or maybe the tools are not picking up this intent everywhere...) -- waiting on the last LG 😆

Cheers,
Rouslan

On Monday, September 26, 2022 at 3:01:18 AM UTC-4 mkwst via Chromestatus wrote:
LGTM2.

Mike Taylor

unread,
Sep 27, 2022, 12:51:36 PM9/27/22
to Rouslan Solomakhin, blink-dev
Nope!

LGTM3
--
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.
Reply all
Reply to author
Forward
0 new messages