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 r.david.murray
Recipients lukasz.langa, r.david.murray, spaceone, terry.reedy, vstinner
Date 2015-11-26.16:56:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1448556967.23.0.446490237606.issue25723@psf.upfronthosting.co.za>
In-reply-to
Content
I view this as similar to the corresponding issue with email headers, where we fixed a similar security issue.  The special danger of \n is that it allows you to create a *new* header, or in this case section, with an arbitrary value, possibly overriding an existing section and thus changing the behavior of the program in an exploitable way.  This is *far* easier to exploit than the ability to introduce arbitrary data into the section name itself.  Good security involves concentric rings of defense, and one should almost always be more secure by default when it has a small usability impact.  In this case, there is no legitimate use for \n in a section name, so the only usability impact would be if some weird program out there was actually making use of this for some reason, against all reasonable logic :).  Which is why we are suggesting changing it only in 3.6.

\x00 is problematic (though somewhat less so) for the same reason, as many file readers will treat it as equivalent to end of line and allow a similar exploit.  \r, \f, and \x1c-\x1e should also be blocked, but otherwise we should probably ignore non-printables for backward compatibility reasons (there we move further into the usability impact area).
History
Date User Action Args
2015-11-26 16:56:07r.david.murraysetrecipients: + r.david.murray, terry.reedy, vstinner, lukasz.langa, spaceone
2015-11-26 16:56:07r.david.murraysetmessageid: <1448556967.23.0.446490237606.issue25723@psf.upfronthosting.co.za>
2015-11-26 16:56:07r.david.murraylinkissue25723 messages
2015-11-26 16:56:06r.david.murraycreate