Is there a way to secure strings for Python's eval?

后端 未结 7 2255
悲哀的现实
悲哀的现实 2021-02-08 07:43

There are many questions on SO about using Python\'s eval on insecure strings (eg.: Security of Python\'s eval() on untrusted strings?, Python: make eval safe).

7条回答
  •  佛祖请我去吃肉
    2021-02-08 07:54

    It's not enough to create input sanitization routines. You must also ensure that sanitization is not once accidentally omitted. One way to do that is taint checking.

提交回复
热议问题