CVE-2012-4406: Code Injection

Published Sep 5, 2012
·
Updated

OpenStack Object Storage (swift) before 1.7.0 uses the loads function in the pickle Python module unsafely when storing and loading metadata in memcached, which allows remote attackers to execute arbitrary code via a crafted pickle object.

Other sources

Sebastian Krahmer (krahmer) reports:

swift uses pickle to store and load meta data. pickle is insecure and allows to execute arbitrary code in loads(). [...] BTW, you can read more on executing code via pickle or cPickle here: http://nadiana.com/python-pickle-insecure

https://bugs.launchpad.net/swift/+bug/1006414

Additionally:

== Pickle is insecure in a model where an untrusted user can provide the pickled data. In the Swift model the data is pickled by Swift itself and stored in memcache, so the attack vector would suppose direct write access by an untrusted user to memcached data ?

== memcached on Swift runs on every proxy servers and shared a cache so it bind on the internal network ip. For swift we always assume that the internal network needs to be secure since Swift has been designed this way.

== The commit message for the fix:

Reviewed: https://review.openstack.org/9105 Committed: http://github.com/openstack/swift/commit/e1ff51c04554d51616d2845f92ab726cb0e5831a Submitter: Jenkins Branch: master

commit e1ff51c04554d51616d2845f92ab726cb0e5831a Author: Vincent Untz <vuntz> Date: Thu Jun 21 14:37:41 2012 +0200

Do not use pickle for serialization in memcache, but JSON

We don't want to use pickle as it can execute arbitrary code. JSON is safer. However, note that it supports serialization for only some specific subset of object types; this should be enough for what we need, though.

To avoid issues on upgrades (unability to read pickled values, and cache poisoning for old servers not understanding JSON), we add a memcacheserializationsupport configuration option, with the following values:

0 = older, insecure pickle serialization 1 = json serialization but pickles can still be read (still insecure) 2 = json serialization only (secure and the default)

To avoid an instant full cache flush, existing installations should upgrade with 0, then set to 1 and reload, then after some time (24 hours) set to 2 and reload. Support for 0 and 1 will be removed in future versions.

Part of bug 1006414.

Change-Id: Id7d6d547b103b4f23ebf5be98b88f09ec6027ce4

Red Hat

Affected Software

32 affected componentsFixes available
pip/swift<1.7.0
1.7.0
Openstack Swift<=1.6.0
Openstack Swift=1.0.0
Openstack Swift=1.0.1
Openstack Swift=1.0.2
Openstack Swift=1.1.0
Openstack Swift=1.1.0-rc1
Openstack Swift=1.1.0-rc2
Openstack Swift=1.2.0
Openstack Swift=1.2.0-gamma1
Openstack Swift=1.2.0-rc1
Openstack Swift=1.3.0
Openstack Swift=1.3.0-gamma1
Openstack Swift=1.3.0-rc1
Openstack Swift=1.4.0
Openstack Swift=1.4.1
Openstack Swift=1.4.2
Openstack Swift=1.4.3
Openstack Swift=1.4.4
Openstack Swift=1.4.5
Openstack Swift=1.4.6
Openstack Swift=1.4.7
Openstack Swift=1.4.8
Openstack Swift=1.5.0
Openstack Swift<1.7.0
Fedoraproject Fedora=16
redhat Gluster Storage Management Console=2.0
redhat Gluster Storage Server For On-premise=2.0
redhat Storage=2.0
redhat Storage For Public Cloud=2.0
redhat Enterprise Linux Server=5.0
redhat Enterprise Linux Server=6.0

Event History

Sep 5, 2012
Data Sourced
via Red Hat·06:42 PM
DescriptionSeverityAffected Software
Oct 22, 2012
CVE Published
via MITRE·11:00 PM
Data Sourced
via MITRE·11:00 PM
Description
May 17, 2022
Advisory Published
via GitHub·01:42 AM
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-4406?

CVE-2012-4406 is classified as a high-severity vulnerability due to its potential for remote code execution.

2

How do I fix CVE-2012-4406?

To remediate CVE-2012-4406, update the OpenStack Swift package to version 1.7.0 or later.

3

What is affected by CVE-2012-4406?

CVE-2012-4406 affects all versions of OpenStack Swift before 1.7.0, particularly versions 1.6.0 and earlier.

4

What type of vulnerability is CVE-2012-4406?

CVE-2012-4406 is a remote code execution vulnerability caused by unsafe use of the pickle module in Python.

5

Who reported CVE-2012-4406?

CVE-2012-4406 was reported by Sebastian Krahmer.

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