This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JohnLeitch
Recipients BreamoreBoy, JohnLeitch, belopolsky, brycedarling, lemburg, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2015-09-05.00:41:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441413694.45.0.694530645404.issue24917@psf.upfronthosting.co.za>
In-reply-to
Content
When I get a bit of slackspace (probably tomorrow afternoon/evening) I can test on the spectrum of versions to confirm the issue is in >= 3.2. I'll also look into improving our automation so all future reports can have the appropriate versions flagged.

Regarding untrusted format strings, I believe you are mistaken. In native applications, untrusted format strings are problematic because an attacker can use injected tokens to read/write arbitrary memory, which can be leveraged to attain code execution.

However, in the context of Python, a format string with too many tokens should be handled safely, resulting in a Python exception rather than exploitable memory corruption. This is the behavior observed in format string handling throughout Python (and indeed most managed/scripting languages). Yes, in most Python programs format strings will be constants, and using dynamically constructed format strings may be considered a bad practice. But, should a developer choose to pass a dynamically constructed string (for example, functionality that allows untrusted users to specify custom time formatting), it's not unreasonable for them to expect memory safety to be maintained.

Of course, if there's a risk I'm overlooking I'd like to better understand it, and the relevant Python documentation should be updated.
History
Date User Action Args
2015-09-05 00:41:34JohnLeitchsetrecipients: + JohnLeitch, lemburg, paul.moore, belopolsky, vstinner, tim.golden, BreamoreBoy, zach.ware, steve.dower, brycedarling
2015-09-05 00:41:34JohnLeitchsetmessageid: <1441413694.45.0.694530645404.issue24917@psf.upfronthosting.co.za>
2015-09-05 00:41:34JohnLeitchlinkissue24917 messages
2015-09-05 00:41:32JohnLeitchcreate