I would like to read in a string from an input file (which may or may not have been modified by the user). I would like to treat this string as a format directive to be called with a fixed number of arguments. However, I understand that some format directives (particularly, the ~/
comes to mind) could potentially be used to inject function calls, making this approach inherently unsafe.
When using read
to parse data in Common Lisp, the language provides the *read-eval*
dynamic variable which can be set to nil
to disable #.
code injection. I'm looking for something similar that would prevent code injection and arbitrary function calls inside format directives.
format
. – Weinman