April 4, 2024, midnight | Maxi Contieri

DEV Community dev.to

A great door for hackers



TL;DR: Don't use metaprogramming. It is not that cool






Problems


  • Security


  • Limited Control






Solutions


  1. Use direct calls


  2. Wrap the execution in a primitive and controlled command


  3. Sanitize it






Context

Developers employ the eval() and exec() functions to evaluate arbitrary expressions from strings.


They can be a powerful tool in certain contexts but come with several risks and problems, especially when used with untrusted input or where the code's behavior is not fully controlled or understood. …

beginners can code command context control developers don door expressions functions great hackers problems programming python security solutions strings tool webdev

Information Security Engineers

@ D. E. Shaw Research | New York City

Technology Security Analyst

@ Halton Region | Oakville, Ontario, Canada

Senior Cyber Security Analyst

@ Valley Water | San Jose, CA

Technical Support Specialist (Cyber Security)

@ Sigma Software | Warsaw, Poland

OT Security Specialist

@ Adani Group | AHMEDABAD, GUJARAT, India

FS-EGRC-Manager-Cloud Security

@ EY | Bengaluru, KA, IN, 560048