CWE
399
Advisory Published
CVE Published
Updated

CVE-2012-0845

First published: Mon Feb 13 2012(Updated: )

Description of problem: When using SimpleXMLRPCServer from the standard library, if a client connection is closed before the complete request body has been received the server will enter an infinite loop consuming memory. Version-Release number of selected component (if applicable): python-2.6.6-29.el6.x86_64 How reproducible: always Steps to Reproduce: 1. Start the server: <span class="quote">&gt;&gt;&gt; import SimpleXMLRPCServer, SocketServer &gt;&gt;&gt; class Server(SocketServer.ThreadingMixIn, SimpleXMLRPCServer.SimpleXMLRPCServer): pass</span> ... <span class="quote">&gt;&gt;&gt; Server(('0.0.0.0', 12345)).serve_forever()</span> 2. Simulate a malicious or flakey client: $ echo -e 'POST /RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nlol bye' | nc localhost 12345 ^C Actual results: Server goes nuts, with a thread stuck in an infinite loop eating memory. Expected results: Bad request is discarded. Additional info: The bug is in /usr/lib64/python2.6/SimpleXMLRPCServer.py at line 453: # Get arguments by reading body of request. # We read this in chunks to avoid straining # socket.read(); around the 10 or 15Mb mark, some platforms # begin to have problems (bug #792570). max_chunk_size = 10*1024*1024 size_remaining = int(self.headers["content-length"]) L = [] while size_remaining: chunk_size = min(size_remaining, max_chunk_size) L.append(self.rfile.read(chunk_size)) size_remaining -= len(L[-1]) data = ''.join(L) This code does not correctly handle EOF from self.rfile.read().

Credit: secalert@redhat.com

Affected SoftwareAffected VersionHow to fix
redhat/python<2.6.8
2.6.8
redhat/python<2.7.3
2.7.3
redhat/python<3.1.5
3.1.5
redhat/python<3.2.3
3.2.3
debian/python2.7
2.7.18-8+deb11u1
Python 2.7<=2.6.7
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
Python 2.7=2.0.1
Python 2.7=2.1
Python 2.7=2.1.1
Python 2.7=2.1.2
Python 2.7=2.1.3
Python 2.7=2.2
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.5.6
Python 2.7=2.5.150
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.6.2150
Python 2.7=2.6.6150
Python 2.7=2.7.1
Python 2.7=2.7.1-rc1
Python 2.7=2.7.2-rc1
Python 2.7=2.7.1150
Python 2.7=2.7.2150
Python 2.7=3.0
Python 2.7=3.0.1
Python 2.7=3.1
Python 2.7=3.1.1
Python 2.7=3.1.2
Python 2.7=3.1.3
Python 2.7=3.1.4
Python 2.7=3.2
Python 2.7=3.2-alpha
Python 2.7=3.2.2150

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Reference Links

Frequently Asked Questions

  • What is the severity of CVE-2012-0845?

    CVE-2012-0845 has a medium severity rating as it can lead to memory exhaustion due to an infinite loop.

  • How do I fix CVE-2012-0845?

    To fix CVE-2012-0845, upgrade your Python installation to version 2.6.8, 2.7.3, 3.1.5, or 3.2.3 or later.

  • What versions of Python are affected by CVE-2012-0845?

    CVE-2012-0845 affects Python versions up to and including 2.6.7, 2.7.2, and 3.1.2.

  • Can CVE-2012-0845 cause denial of service?

    Yes, CVE-2012-0845 can cause denial of service by forcing the server into an infinite loop, consuming system resources.

  • Is CVE-2012-0845 applicable to all Python applications?

    CVE-2012-0845 is specifically related to applications using SimpleXMLRPCServer from the Python standard library.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203