Dynamic Code Execution (ARCH8131)
هذا المحتوى غير متوفر بلغتك بعد.
Key kotlin.security.dynamic-code-execution · Severity critical · Category security · CWE CWE-95
Flags ScriptEngine.eval / Groovy shell evaluate with a script built from request data.
Incorrect
Section titled “Incorrect”engine.eval(req.getParameter("expr"))Correct
Section titled “Correct”val allowed = mapOf("sum" to ::sum)allowed[req.getParameter("op")]?.invoke(args)Never evaluate user input as code; map requests onto a fixed set of operations.