Python Format String Injection
.format() method allows accessing object attributes and methods. When user input is used in format strings, attackers can access sensitive application internals
Vulnerable Code Patterns
user_input = request.args.get('name')
message = "Hello {}".format(user_input)template = request.args.get('template')
secret_key = "my-secret-key"
result = template.format(secret=secret_key)log_message = user_input
logger.info(log_message.format(config=app.config))Last updated