-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fix constructor exploit on NodeJS #37
base: master
Are you sure you want to change the base?
Conversation
170eee1
to
e99fe4e
Compare
@gpascualg as far as I understand, you only secure the exposed methods, but not the |
@asvd It is tested and no longer can be exploited this way. |
you are right, missed that |
The code looks good to me, why isn't it being merged? |
@lu4 for the given issue (#33) I currently see two directions towards the solution:
I like the first approach more, and am going to investigate into that direction. As for this pull request, I did not merge it because I would prefer to avoid external dependencies (harmony-reflect), especially for such a basic case. More proper way would be to figure out how Proxy is emulated by harmony-reflect (and if it is secure enough for the purpose by the way), and reuse that trick right in place. If someone reimplements this pull request in the way I described, before I implement the first point, I think I would merge it and drop my further investigations |
The |
Attemps to fix #33 by wrapping all exposed objects into a Proxy object, which restricts get/set operations.
It is tested but not extensibly. Solves the main issue with constructor, and maybe some others with prototype, but might introduce some others (I'm new to this, so who knows).
On the downside, requires https://github.com/tvcutsem/harmony-reflect to port Proxy to NodeJS.
EDIT (Already fixed): Accidentaly I commited the exception code too, let me fix it.
The recursivity in
get
/set
is to also fix attemps like:That would otherwise also work