r/shittyprogramming • • Jan 16 '20

JavaScript: it's a security risk

Overheard on a call one of my colleagues just got off of:

Colleague: "So why aren't you able to add our JavaScript to your checkout page?"

Client: "Oh, we disable JavaScript on our entire checkout page."

Colleague: "...why?"

Client: "It's a security risk."

Colleague: <head explodes>

136 Upvotes

72 comments sorted by

View all comments

Show parent comment

4

u/path411 Jan 17 '20

There's a large difference between 3rd party javascript and 1st party on your checkout. I would almost never just "throw some script onto checkout" that some company told me to. And honestly no javascript on a checkout is not "shittyprogramming". Chances are, you prob don't really need javascript on your checkout.

2

u/Xyexs Jan 17 '20

I'm not saying you've said anything wrong, but for clarity's sake: The thread is about 1st party javascript.

2

u/path411 Jan 17 '20

"So why aren't you able to add our JavaScript to your checkout page?"

No it aint

1

u/Xyexs Jan 17 '20 edited Jan 18 '20

Oh I misread that, I thought they were the only devs and the client were setting restrictions. My bad.

1

u/robertbieber Jan 18 '20

There's a large difference between 3rd party javascript and 1st party on your checkout.

I mean, yes, but most of the time the difference is that the third party stuff is better written and much better tested than whatever someone hacked up in house

I would almost never just "throw some script onto checkout" that some company told me to.

We're talking about a colleague here, not some rando asking you to add something to your site.

And honestly no javascript on a checkout is not "shittyprogramming".

Being smart about what JavaScript you add makes perfect sense. Purposely degrading the functionality of your checkout page because you have an irrational fear of JavaScript, however, is just straight cargo cult nonsense. Especially given that the alternative is POSTing PCI sensitive payment data directly to your own servers where, congrats, now you're responsible for it and the fallout of any data breach