News for hackers. Stuff that matters.
Re:PyPy.js: Python in the web browser by lucb1e on Wednesday August 22, 2018 @01:13PM (#17820202)
This is Javascript, not real Python. If you're so afraid that this is dangerous, why do you post malicious code? And if you're so clever to post that code, why don't you try similar code to see if it really has access to your files?

    import os
    os.listdir('/')
The answer, by the way, is no.
Re:PyPy.js: Python in the web browser by Alupis on Wednesday August 22, 2018 @01:36PM (#17820374)
> If you're so afraid that this is dangerous, why do you post malicious code?

That's not malicious code... it removes files from a sandbox... you can refresh the page and see for yourself.

> And if you're so clever to post that code

There's no need to be rude... there's an honest question and lack of understanding in my post - educate me, don't talk down to me.

> why don't you try similar code to see if it really has access to your files

The question was if someone could break out of a sandbox, such as with Java Applets and Adobe Flash. I have no idea how to do that - I'm not a security specialist, nor some sort of hacker guy.

> The answer, by the way, is no.

From the sandbox and using the standard `import os`, ya, you're right. The question, again, is what if someone got outside the sandbox?

Re:PyPy.js: Python in the web browser by lucb1e on Wednesday August 22, 2018 @03:45PM (#17821458)
Thanks for the elaborate response, now I much better understand what you're trying to say.

This is different from the examples you mention: there is no external software that creates the sandbox (whereas with Java and Flash you had to install those as plugins). It's really just Javascript as it is built into the browser. Any vulnerability in this "sandbox" is a vulnerability in the browser, not some 3rd party plugin.

Put differently, this pypy emulation is no different from the Javascript API that was in your browser already. This isn't a new plugin, just using Javascript to emulate Python through the Pypy interpreter.

Re:PyPy.js: Python in the web browser by Macha on Wednesday August 22, 2018 @01:41PM (#17820420)
Well why doesn't this apply to JS? The python interpreter is running in the JS sandbox
Re:PyPy.js: Python in the web browser by Alupis on Wednesday August 22, 2018 @01:51PM (#17820500)
I suppose that was the explanation I was looking for.