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/Freakei Jan 30 '20

In this case you would have to ban CSS too, as you can create a keylogger with it, too.

1

u/Earhacker Jan 30 '20

Not really. You’d only have to disallow 3rd party CSS that you (the app developers) have no control over, e.g. Bootstrap. Developers are much less likely to pull in 3rd party CSS than they are 3rd party JavaScript.

You’re right that it’s a vulnerability, but who cares if the app itself is logging the user’s keystrokes? The user is about to send them the password in a form anyway.

1

u/Freakei Jan 30 '20

I partially disagree, a lot of devs use 3rd party CSS frameworks (like Bootstrap) where they can’t be 100% sure that no malicious CSS is container.

The app itself logging is not a problem, you are right, but technically it‘s the same with 100% self-made JS.