I\'m working on a web app where users will be able to supply strings that the server will then substitute variables into.
Preferably I\'d like to use PEP 3101 format
Good instinct. Yes, an attacker being able to supply arbitrary format string is a vulnerability under python.
Object
parent class has any useful
information. The object supplied to the format would have to contain
something sensitive. In any case, this type of notation can limited
with a regular expression.Look over the python format string specification and forbid functionality you don't want the user to have with a regex.