I read this Q&A and I'm not convince it applies here.
I have an application where I want to allow mostly preset formulas to be set in widgets: for instance return last part of a string using str.partition
.
This isn't a webapp but a wx.widgets
one, only company employees can use it so the risk is minimal, but how could I apply a minimum of security to avoid malignant attacks or simply unaware user errors?
I thought of scanning for ;
so one cannot import a module or pass 2 instructions, and also scan for os.
and sys.
(which are already imported in my program so no need to import them to use os.remove
), and too bad if os.
or sys.
are in expressions, that is very unlikely.
Would that be reasonably enough or am I missing a blatant safety/security gap?