-
Notifications
You must be signed in to change notification settings - Fork 93
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
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript functions. #92
Comments
joetIO
changed the title
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript's functions. bug with tokens having the same name as object.prototype members
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript functions. bug with tokens having the same name as object.prototype members
Oct 1, 2020
joetIO
changed the title
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript functions. bug with tokens having the same name as object.prototype members
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript functions. bug with tokens having the same names as object.prototype members
Oct 1, 2020
joetIO
changed the title
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript functions. bug with tokens having the same names as object.prototype members
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript functions. and a bug with tokens having the same names as object.prototype members
Oct 1, 2020
joetIO
changed the title
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript functions. and a bug with tokens having the same names as object.prototype members
the evaluator allows for arbitrary access to objects' prototypes & invoking of Javascript functions.
Oct 1, 2020
Any updates on this? Seems like a pretty important security issue.. |
oatkachenko
added a commit
to elsci-io/elsci-jexl
that referenced
this issue
Jun 18, 2021
…r invoke Javascript functions
oatkachenko
added a commit
to elsci-io/elsci-jexl
that referenced
this issue
Aug 25, 2022
…otypes or invoke Javascript functions" This reverts commit 80fa1d5.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Tom.
I'm writing an app where untrusted users are able to write their custom Jexl expressions. Expressions get executed on a server.
I'm defining few little identifiers & functions mostly primitive types, So i was not worry about security issues. However, While i was developing the software i found that users are able to access any object prototype. e.g I was able to access
Function.prototype
. Even without any identifier or any function defined on my side:And i was able to invoke Javascript functions on asynchronous eval. -was not able to pass any arguments:
By using Object.prototype.valueOf i should be able to get the output of the functions synchronously. However, It's not working because of a bug in the parser; The parser thinks that valueOf is a Jexl token because it's defined on Object.prototype and the parser uses a Javascript object to store the tokens. however by fixing that bug, valueOf can be used to call any javascript function, like in this case by deleting valueOf from Object.prototype:
Suggested fixes:
JSON.stringify(jexl.evalSync('{ toJSON: ..... }'))
.Object.hasOwnProperty
.I'm down to make a pull request to fix these issues.
The text was updated successfully, but these errors were encountered: