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

Execute JS in mongodb using $where #221

Open
exploitx3 opened this issue Mar 19, 2018 · 0 comments
Open

Execute JS in mongodb using $where #221

exploitx3 opened this issue Mar 19, 2018 · 0 comments

Comments

@exploitx3
Copy link

Description:
Creating a request using filter[$where]= allows executing javascript in the mongodb instance.
If used against mongodb instances which are lower than 2.4 version it could have big impact as in the $where function scope the "db" object is exposed.
https://docs.mongodb.com/manual/reference/operator/query/where/

For version 2.4 and later it is not that big of an issue
And for mongodb version 2.2.4 there are exploit in exploitdb.

Reproduce:
Call:
GET host:port/resource?filter[$where]=function(){throw Error(version())}
screen shot 2018-03-19 at 18 25 11

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

1 participant