Re:Netflix disables use of the Chrome developer console
by comex on Thursday March 06, 2014 @02:42AM
(#7352414)
The developer console has access to everything the origin does. If the user can do it, the console can do it.
[ Parent
| on HN ]
Re:Netflix disables use of the Chrome developer console
by Drakim on Thursday March 06, 2014 @02:54AM
(#7352451)
Not necessarily, because you can limit how certain values can be accessed due to your scope. For JavaScript, if a key is saved in a variable inside an anonymous function, it's inaccessible for somebody who has a console that sits at the root of the document.
Re:Netflix disables use of the Chrome developer console
by chrisfarms on Thursday March 06, 2014 @03:45AM
(#7352601)
> fn = function(){ var key = "shhhhh" }
> fn.toString()
'function (){ var key = "shhhhh" }'
Nothing is sacred in JS.
Re:Netflix disables use of the Chrome developer console
by Drakim on Thursday March 06, 2014 @04:22AM
(#7352710)
A very nifty trick!
But it requires that the value is hardcoded inside the function. If it was given to an unreachable scope by some async action (like an ajax request) this trick wouldn't work.
One could possibly also wrap the function in an native .bind call to change the output of toString() to [native code]
Re:Netflix disables use of the Chrome developer console
by konklone on Thursday March 06, 2014 @01:20PM
(#7355550)
I wonder if even that's feasibly secure though, when you have stuff like http://esprima.org that can let you fully parse the entirety of the JS on the page.
It's better to assume the console has 100% root (client-side) privileges.
Re:Netflix disables use of the Chrome developer console
by Drakim on Friday March 07, 2014 @11:15AM
(#7361020)
But the enemy here isn't necessarily the console, it's the social attack against the console. Making it harder for the user to screw himself over is a worthwhile endeavor, and not merely "security by obscurity".
Re:Netflix disables use of the Chrome developer console
by cobbal on Thursday March 06, 2014 @05:39AM
(#7352959)
It would be harder, but the developer console has access to closures as well:
Re:Netflix disables use of the Chrome developer console
by tantalor on Thursday March 06, 2014 @03:01AM
(#7352467)
document.getElementsByTagName('script')[0].innerText
Re:Netflix disables use of the Chrome developer console
by brokenparser on Thursday March 06, 2014 @04:27AM
(#7352728)
.innerText is an MSIE extension, .textContent is a DOM standard property.