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

Ability to restrict built in functions and operators #91

Open
njdoyle opened this issue Feb 27, 2018 · 3 comments
Open

Ability to restrict built in functions and operators #91

njdoyle opened this issue Feb 27, 2018 · 3 comments

Comments

@njdoyle
Copy link

njdoyle commented Feb 27, 2018

I would like to build expressions with fewer functions and operators than are provided by the builtins. I would like the option to build expressions where I select (whitelist) my own base set of functions and operators instead of being forced to have the builtins available to all expressions.

@RobertZenz
Copy link

Just the other day I was thinking about adding such a possibility while working on a similar library. After some thinking I was unable to come up with a use-case which would actually require that the default functions are not available (overwritten/replaced, yes, gone, no). So I'm very curious as to what you're doing and why you require that?

@njdoyle
Copy link
Author

njdoyle commented Apr 4, 2018

The use case revolves around limiting what's possible with user provided expressions. Some of these builtin functions are slow and are unnecessary for the use case. Slow functions can contribute to DoS attacks. Removing these builtin functions combined with other user input validation/sanitization helps reduce the attack surface. Removing unnecessary functions also helps prevent users from shooting themselves in the foot doing unnecessarily complicated math.

@RobertZenz
Copy link

I haven't been looking at it from this angle, very interesting and quite good fuel for thought, thank you.

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