I have an html page with a textfield for the user to put expressions like these:
(x+23)*2
((x-y)*(x+y))
x*2/z+y
The user enters them and I use the 'eval' method to execute them. Before calling eval I make a check that there is nothing dodgy (like attempting to define a function or similar).
It seems to me that I should be fine. But am I introducing a security hole because I call 'eval' on user's string. what's the risk ?