CVE-2012-0845: Medium severity python 2.7 vulnerability

Published 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.x8664

How reproducible:

always

Steps to Reproduce:

1. Start the server: >>> import SimpleXMLRPCServer, SocketServer >>> class Server(SocketServer.ThreadingMixIn, SimpleXMLRPCServer.SimpleXMLRPCServer): pass ... >>> Server(('0.0.0.0', 12345)).serveforever()

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). maxchunksize = 1010241024 sizeremaining = int(self.headers["content-length"]) L = [] while sizeremaining: chunksize = min(sizeremaining, maxchunksize) L.append(self.rfile.read(chunksize)) sizeremaining -= len(L[-1]) data = ''.join(L)

This code does not correctly handle EOF from self.rfile.read().

Other sources

SimpleXMLRPCServer.py in SimpleXMLRPCServer in Python before 2.6.8, 2. ...

Debian

Affected Software

63 affected componentsFixes available
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
Python Python<=2.6.7
Python Python=0.9.0
Python Python=0.9.1
Python Python=1.2
Python Python=1.3
Python Python=1.5.2
Python Python=1.6
Python Python=1.6.1
Python Python=2.0
Python Python=2.0.1
Python Python=2.1
Python Python=2.1.1
Python Python=2.1.2
Python Python=2.1.3
Python Python=2.2
Python Python=2.2.1
Python Python=2.2.2
Python Python=2.2.3
Python Python=2.3.1
Python Python=2.3.2
Python Python=2.3.3
Python Python=2.3.4
Python Python=2.3.5
Python Python=2.3.7
Python Python=2.4.1
Python Python=2.4.2
Python Python=2.4.3
Python Python=2.4.4
Python Python=2.4.6
Python Python=2.5.1
Python Python=2.5.2
Python Python=2.5.3
Python Python=2.5.4
Python Python=2.5.6
Python Python=2.5.150
Python Python=2.6.1
Python Python=2.6.2
Python Python=2.6.3
Python Python=2.6.4
Python Python=2.6.5
Python Python=2.6.6
Python Python=2.6.2150
Python Python=2.6.6150
Python Python=2.7.1
Python Python=2.7.1-rc1
Python Python=2.7.2-rc1
Python Python=2.7.1150
Python Python=2.7.2150
Python Python=3.0
Python Python=3.0.1
Python Python=3.1
Python Python=3.1.1
Python Python=3.1.2
Python Python=3.1.3
Python Python=3.1.4
Python Python=3.2
Python Python=3.2-alpha
Python Python=3.2.2150
debian/python2.7
2.7.18-8+deb11u1

Event History

Oct 5, 2012
CVE Published
via MITRE·09:00 PM
Data Sourced
via MITRE·09:00 PM
Description
Jan 11, 2024
Data Sourced
via Launchpad·09:58 PM
Description
Sep 20, 2024
Data Sourced
via Ubuntu·12:44 AM
RemedyDescriptionSeverityAffected Software
Feb 27, 2025
Data Sourced
via Debian·01:11 AM
DescriptionAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

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.

2

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.

3

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.

4

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.

5

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.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203