Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
make eval() safe
#2
You might find this interesting.

https://wiki.python.org/moin/SandboxedPython

The problem, as I see it, is disallowing import. If you can control import you can evaluate Python expressions in a carefully controlled context that eliminates access to all the dangerous parts.
Gribouillis likes this post
Reply


Messages In This Thread
make eval() safe - by Skaperen - Mar-22-2022, 02:43 AM
RE: make eval() safe - by deanhystad - Mar-22-2022, 03:59 AM
RE: make eval() safe - by snippsat - Mar-22-2022, 03:20 PM
RE: make eval() safe - by Skaperen - Mar-22-2022, 05:29 PM
RE: make eval() safe - by snippsat - Mar-22-2022, 07:15 PM
RE: make eval() safe - by Skaperen - Mar-24-2022, 05:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  is this string shell quote safe? Skaperen 2 2,198 Feb-18-2020, 12:56 AM
Last Post: Skaperen
  eval() function security Skaperen 8 3,866 Sep-23-2019, 04:32 AM
Last Post: Skaperen
  after py2 EOL, is it safe to repoint python? Skaperen 6 3,371 Sep-14-2019, 10:37 AM
Last Post: snippsat
  safe text to html Skaperen 10 11,794 Jul-07-2017, 04:23 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020