3 ms·
I was pretty sure that if its comming from a different domain that this is not the case. For example: If we have legitsite.com/json-only-with-sensitive-data.j
by joshstrange 13y ago
I was pretty sure that if its comming from a different domain that this is not the case.
For example:
If we have legitsite.com/json-only-with-sensitive-data.js and we load that by adding a script tag to attackersite.com then attackersite.com cannot get the contents of what the legit site returned.
The problem is when you either have JSONP (for which the attacker site could add a callback in the request to execute) or if you return js code that is supposed to run like in this blog post where RoR returns code like this:
$('#someid').html('sensitive data');
...
In this case it's just as bad as having JSONP because the attacker site can create a <div id='someid'></div> then add the script tag then onLoad of the script tag inspect the contents of the div.