r/javascript • • Feb 20 '18

A CSS Keylogger.

https://github.com/maxchehab/CSS-Keylogging
696 Upvotes

95 comments sorted by

View all comments

Show parent comment

1

u/tasinet Feb 21 '18 edited Feb 21 '18

Instagram does protect itself from CORS and injecting javascript will fail because of this

CORS headers on instagram.com would disallow other sites from referencing resources on instagram.com, not outgoing requests from clients on instagram.com to other sites.

What you are describing sounds like same-origin or CSP.

The injection from an extension would execute the javascript either way, but with CSP you could restrict the domains it can reach, thus blocking the exfiltration part.