Live data from Hacker News

Payment iframe - the easiest way to insert Stripe into your website

paymentiframe.com

61–70 of 84 posts

Re: Payment iframe - the easiest way to insert Stripe into your website

#61
post #37

If I was Stripe I'd be politely asking you to take this down. It's using their trademark (presumably) without permission and encouraging their users to do something very inadvisable. Offering to host this seems like a really bad idea. I know you're well meaning and trustworthy, but this shouldn't be run by a third party. For long term reliability reasons as much as security.

I showed it to people at Stripe before announcing it.

Surprising that they would okay it, but their call I suppose.

Re: Payment iframe - the easiest way to insert Stripe into your website

#62

Earlier quoted context omitted.

How can I be sure that it is static? And if it is static today, who's to say it won't be static tomorrow? What if the website's domain expires, and somebody snaps it up and puts something in its place? What if cperciva sells the domain to someone else? I am not endorsing the use of third-party JavaScript on someone's payment page. I am also not endorsing the use of serving your payment form inside of a third-party if…

@tctapek - re: fetching another URL, just use a subdomain exclusive for processing payments (i.e. http://payments.yourdomain.com ).

Any Javascript you inject into the front page of your app owns the customer experience entirely. It does not matter that you set up a subdomain to send people to for payments; malicious Javascript is just going to "send" users to an extremely authentic looking facsimile of that domain.

Re: Payment iframe - the easiest way to insert Stripe into your website

#63

Earlier quoted context omitted.

@tctapek - re: fetching another URL, just use a subdomain exclusive for processing payments (i.e. http://payments.yourdomain.com ).

@cperciva – wrong. Both pages have to opt into the same domain for that to work. As in, even if the "evil script" set it's domain to yourdomain.com, unless your pages on yourdomain.com ALSO do document.domain = 'yourdomain.com'; The script on the subdomain can't access that content. [EDIT] Whoever is downvoting this, can you demonstrate otherwise?

My understanding is that pages from yourdomain.com would already have document.domain set to 'yourdomain.com', but I'm not a javascript expert.

Re: Payment iframe - the easiest way to insert Stripe into your website

#64

Earlier quoted context omitted.

How can I be sure that it is static? And if it is static today, who's to say it won't be static tomorrow? What if the website's domain expires, and somebody snaps it up and puts something in its place? What if cperciva sells the domain to someone else? I am not endorsing the use of third-party JavaScript on someone's payment page. I am also not endorsing the use of serving your payment form inside of a third-party if…

@tctapek - re: fetching another URL, just use a subdomain exclusive for processing payments (i.e. http://payments.yourdomain.com ).

bentlegen _is_ an expert in third party javascript, and is correct that both domains need to opt in to a `document.domain` even if they would match with only one changing. This is to prevent this exact security exploit.

Re: Payment iframe - the easiest way to insert Stripe into your website

#65

Earlier quoted context omitted.

@tctapek - re: fetching another URL, just use a subdomain exclusive for processing payments (i.e. http://payments.yourdomain.com ).

@cperciva – wrong. Both pages have to opt into the same domain for that to work. As in, even if the "evil script" set it's domain to yourdomain.com, unless your pages on yourdomain.com ALSO do document.domain = 'yourdomain.com'; The script on the subdomain can't access that content. [EDIT] Whoever is downvoting this, can you demonstrate otherwise?

@cperciva – it is and it isn't. Implicit vs explicit. This answer expands:

http://stackoverflow.com/a/3978372

Re: Payment iframe - the easiest way to insert Stripe into your website

#66

Earlier quoted context omitted.

@tctapek - re: fetching another URL, just use a subdomain exclusive for processing payments (i.e. http://payments.yourdomain.com ).

bentlegen _is_ an expert in third party javascript, and is correct that both domains need to opt in to a `document.domain` even if they would match with only one changing. This is to prevent this exact security exploit.

This part of the discussion is a bit of a sideshow, isn't it? PAYMENTS.YOURDOMAIN.COM is not in fact a real mitigation for malicious Javascript on WWW.YOURDOMAIN.COM.

Re: Payment iframe - the easiest way to insert Stripe into your website

#67

Earlier quoted context omitted.

@cperciva – wrong. Both pages have to opt into the same domain for that to work. As in, even if the "evil script" set it's domain to yourdomain.com, unless your pages on yourdomain.com ALSO do document.domain = 'yourdomain.com'; The script on the subdomain can't access that content. [EDIT] Whoever is downvoting this, can you demonstrate otherwise?

@cperciva – it is and it isn't. Implicit vs explicit. This answer expands: http://stackoverflow.com/a/3978372

This reminds me of the WAT talk.

It's also crazy enough that I wouldn't want to trust that every browser in the world will always share that same behaviour.

Re: Payment iframe - the easiest way to insert Stripe into your website

#68
post #66

Earlier quoted context omitted.

bentlegen _is_ an expert in third party javascript, and is correct that both domains need to opt in to a `document.domain` even if they would match with only one changing. This is to prevent this exact security exploit.

This part of the discussion is a bit of a sideshow, isn't it? PAYMENTS.YOURDOMAIN.COM is not in fact a real mitigation for malicious Javascript on WWW.YOURDOMAIN.COM.

Seems like the best solution from where I'm sitting.

Listen, if you don't trust Stripe's JavaScript, just use their HTTP API instead from your server: https://stripe.com/docs/api

Re: Payment iframe - the easiest way to insert Stripe into your website

#69
post #66

Earlier quoted context omitted.

This part of the discussion is a bit of a sideshow, isn't it? PAYMENTS.YOURDOMAIN.COM is not in fact a real mitigation for malicious Javascript on WWW.YOURDOMAIN.COM.

Seems like the best solution from where I'm sitting. Listen, if you don't trust Stripe's JavaScript, just use their HTTP API instead from your server: https://stripe.com/docs/api

You can't do that without incurring a PCI Audit, can you?

The best answer is "don't link to Javascript URLs that you don't control and audit on your website". Nobody likes that answer, but that doesn't make the second-best answer any more meaningful.

Re: Payment iframe - the easiest way to insert Stripe into your website

#70
post #69

Earlier quoted context omitted.

Seems like the best solution from where I'm sitting. Listen, if you don't trust Stripe's JavaScript, just use their HTTP API instead from your server: https://stripe.com/docs/api

You can't do that without incurring a PCI Audit, can you? The best answer is "don't link to Javascript URLs that you don't control and audit on your website". Nobody likes that answer, but that doesn't make the second-best answer any more meaningful.

You can't do that without incurring a PCI Audit, can you?

Exactly. There's no way I would be serving up third party javascript to a logged-in Tarsnap user, even inside an iframe, if it weren't for the fact that dealing with PCI auditing would irreparably damage my sanity.

Post reply on HN