3 ms·
Not a fix at all. The client can examine the returned code.
by TylerE 13y ago
Not a fix at all. The client can examine the returned code.
- joshstrange 13y agoI 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.
- ivanhoe 13y agoCan you show an example how? Not 100% sure, but I believe all major browsers will block the direct access to the content of an external JS file from a different domain? You get just an empty string if accessing it from the DOM (at least in chrome)