I'm working on a large ASP.NET software product. We'd like to allow users to enter expressions rather than constants for certain fields. Typically something like:
(Price * 1.175) + 25
The obvious solution seems to be to embed IronPython, create a Scope, pass in the "Price" (and other) variables and then execute the above as IronPython code.
However, there would be nothing stopping users from entering:
1 / 0
or
def func1():
func1()
func1()
or
import System.IO
File.Delete(....)
But if I catch all exceptions and run the IronPython code in an Application Domain with the Internet permission set, am I safe?