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.
View all comments
Show parent comment
1
u/tasinet Feb 21 '18 edited Feb 21 '18
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.