powered by
Secure formula validation using allowlist approach Prevents code injection while allowing legitimate statistical formulas
validateSafeFormula(fmla, additional_allowed_functions = NULL)
Invisibly returns `NULL`. Throws an error if the formula contains security violations.
A formula object to validate.
Optional character vector of extra function names to permit for this validation call.
# Safe usage: validateSafeFormula(y ~ x + z) validateSafeFormula(y ~ I(x^2) + log(z)) if (FALSE) { # Blocks dangerous code (throws an error): validateSafeFormula(y ~ I(system('whoami'))) }
Run the code above in your browser using DataLab