Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe use of eval #18

Open
cristianstaicu opened this issue Apr 8, 2016 · 1 comment
Open

Unsafe use of eval #18

cristianstaicu opened this issue Apr 8, 2016 · 1 comment

Comments

@cristianstaicu
Copy link

Even though the comment says the eval in lib/serialization.js is harmless:

function deserializeFromGUI(data) {
    var res;
    data = data.replace(/^.+=[^{]+/, '');
    eval('res = ' + data);
    return res;
}

I think it is still a big security risk. Allowing someone to manipulate your database with a tool like mongo-edit should not allow arbitrary code execution on the server where the app is deployed. Imagine the impact of combining something like this with XSS (See the book "Hacking: The Next Generation" for details on such a complex attack)! I suggest using some validation on the data using regexs or using a sanitization package like:
https://www.npmjs.com/package/eval-sanitizer

@WORMSS
Copy link

WORMSS commented May 5, 2017

So @cristianstaicu, I am guessing the maintainers are dying in a ditch somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants