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

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