DEV Community

Discussion on: Missed Frontend Vulnerabilities (1): CSS is not as safe as you think!

Collapse
 
mizadmehr profile image
Mojtaba Izadmehr

Indeed, but the issue is that if they use something like the dormant approach we used here, the network requests will only happen when they want it to happen.
So It is possible that you never see any network requests, but 6 months later, they can change the content of their internally @imported keylogger, and turn it on four a few hours and steal credentials of your users in that period of time. I'd say if they do this in a smart way, it is impossible for you to figure out.

Collapse
 
wisniewski94 profile image
Wiktor Wiśniewski

Popular CDNs have hashes in file names so you can't update CSS without anybody noticing it.
If you use some cheeky third parties to host your assets then well - it's your fault.

Thread Thread
 
mizadmehr profile image
Mojtaba Izadmehr

That's a good point, now I'm curious to see if there is any workaround for that one, or if there are any CSS libraries in this third parties which still uses @import. I would hope not, but I'd guess so.
If you get it from npm, then still the issue remains.

Thread Thread
 
wisniewski94 profile image
Wiktor Wiśniewski

Yes, npm is full of vulnerabilities and when you start using open source libraries you basically take that risk.

I highly recommend using snyk.io to keep an eye on your libs. It's not free. History knows a lot about people who saved a dollar on security.

Personally, I would think twice or maybe even tens of times if I had to include an o-s library in the enterprise level app. Or an app that actually makes money.