~/talk

Safely eval Python syntax using the AST module

Talkat PyCon AU 2019 · 2019-08-02..08-06· [python]
links:none on file
slides:none on file

Claims a safe eval pipeline that parses user Python into the AST module, rejects disallowed node types by whitelist nodes, limits call targets (only specific string methods and a small allowed name set), and either executes against a minimal environment or rewrites the tree to transform tree to custom code. Production use includes bank event/rule matching with permission checks and altered equality semantics for None; pen testing passes but deeply nested input can cause stack/recursion failures so size limits are required.

AI-written summary · about

  1. 0:00Intro
  2. 2:40Bank use case
  3. 3:40Good uses
  4. 4:20Dangerous uses
  5. 5:00What does it do
  6. 5:40What could happen
  7. 7:35Syntax tree
  8. 9:10What are you trying to protect
  9. 10:20Code example
  10. 16:00Permissions
  11. 16:25Generating code
  12. 17:00Security considerations
  13. 18:00Audience questions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.