First published: Wed Mar 14 2012(Updated: )
A flaw was reported [1] in Python's SimpleHTTPServer's list_directory() function. Due to a missing charset parameter, if a user were to connect to SimpleHTTPServer using IE7, which engages in encoding-sniffing and can be tricked into interpretting the output as UTF7. Because of this, an attacker could hide <script> tags in UTF7-encoded characters which do not get quoted by cgi.encode(), allowing XSS attacks. This has been corrected upstream in version 2.6.7rc2 [2], 2.5.6c1 [3]. It may be fixed in 2.7 as well, but I was unable to find a commit to match it against. [1] <a href="http://bugs.python.org/issue11442">http://bugs.python.org/issue11442</a> [2] <a href="http://svn.python.org/view/python/branches/release26-maint/Lib/SimpleHTTPServer.py?r1=66717&r2=88831&view=patch">http://svn.python.org/view/python/branches/release26-maint/Lib/SimpleHTTPServer.py?r1=66717&r2=88831&view=patch</a> [3] <a href="http://svn.python.org/view/python/branches/release25-maint/Lib/SimpleHTTPServer.py?r1=53148&r2=88815&view=patch">http://svn.python.org/view/python/branches/release25-maint/Lib/SimpleHTTPServer.py?r1=53148&r2=88815&view=patch</a>
Credit: secalert@redhat.com
Affected Software | Affected Version | How to fix |
---|---|---|
debian/python2.7 | 2.7.18-8+deb11u1 | |
Python 2.7 | <=2.5.6 | |
Python 2.7 | =0.9.0 | |
Python 2.7 | =0.9.1 | |
Python 2.7 | =1.2 | |
Python 2.7 | =1.3 | |
Python 2.7 | =1.5.2 | |
Python 2.7 | =1.6 | |
Python 2.7 | =1.6.1 | |
Python 2.7 | =2.0.1 | |
Python 2.7 | =2.1.1 | |
Python 2.7 | =2.1.2 | |
Python 2.7 | =2.1.3 | |
Python 2.7 | =2.2.1 | |
Python 2.7 | =2.2.2 | |
Python 2.7 | =2.2.3 | |
Python 2.7 | =2.3.1 | |
Python 2.7 | =2.3.2 | |
Python 2.7 | =2.3.3 | |
Python 2.7 | =2.3.4 | |
Python 2.7 | =2.3.5 | |
Python 2.7 | =2.3.7 | |
Python 2.7 | =2.4.1 | |
Python 2.7 | =2.4.2 | |
Python 2.7 | =2.4.3 | |
Python 2.7 | =2.4.4 | |
Python 2.7 | =2.4.6 | |
Python 2.7 | =2.5.1 | |
Python 2.7 | =2.5.2 | |
Python 2.7 | =2.5.3 | |
Python 2.7 | =2.5.4 | |
Python 2.7 | =2.6.1 | |
Python 2.7 | =2.6.2 | |
Python 2.7 | =2.6.3 | |
Python 2.7 | =2.6.4 | |
Python 2.7 | =2.6.5 | |
Python 2.7 | =2.6.6 | |
Python 2.7 | =2.7.1 | |
Python 2.7 | =2.7.1-rc1 | |
Python 2.7 | =2.7.2-rc1 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2011-4940 has been assigned a moderate severity level due to its potential for information disclosure through improper handling of character encoding.
To remediate CVE-2011-4940, upgrade to the fixed versions of Python that include the charset parameter in the list_directory() function.
CVE-2011-4940 affects Python versions up to 2.5.6 and versions 2.6.x prior to patches that address this issue.
Yes, CVE-2011-4940 can be exploited remotely if an attacker tricks users into connecting to a vulnerable SimpleHTTPServer.
The cause of CVE-2011-4940 is a flaw in the list_directory() function of Python's SimpleHTTPServer due to a missing charset parameter.