contextify icon indicating copy to clipboard operation
contextify copied to clipboard

Global variables can stil be accessed using caller attack

Open machadogj opened this issue 13 years ago • 2 comments

Hi, I have done a simple gist showing this: https://gist.github.com/4557432

Basically, creating a function, and calling it gives you access to the function's caller's caller's caller's until you reach a function that executes javascript code, which allows you to in turn execute code that will have access to global variables.

Sorry, but I have no ideas on how to mitigate this, except that the sandbox module somehow prevents this.

machadogj avatar Jan 17 '13 16:01 machadogj

Interesting. The goal for Contextify isn't to provide security, but instead to provide correct semantics for JavaScript execution (it was written to implement the window context in JSDOM). If there's a nice way to fix this, I'd accept a PR, but I don't have any interest in digging into this myself.

brianmcd avatar Mar 21 '13 23:03 brianmcd

Hi!

I know this is kind of old, but I'm interested in helping improve security for Contextify. Using the latest versions of Contextify and Node cloned out of github, I can't seem to be able to walk the caller list. I seem to get a null caller when I reach the sandbox toplevel. Any idea what might have changed to cause this?

Thanks!

idoby avatar Aug 11 '15 12:08 idoby