summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-swift
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2014-05-07 14:20:09 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-05-08 14:30:03 -0400
commitfd1371e01ea808309b76a72cc9a161c72e148279 (patch)
treec4a3063e4ec20cdea5589341b931cfe76d2dbde9 /meta-openstack/recipes-devtools/python/python-swift
parentf1875da73f07825ad468648c6d154478a8673089 (diff)
downloadmeta-cloud-services-fd1371e01ea808309b76a72cc9a161c72e148279.tar.gz
CVE-2014-0006 Openstack Swift: TempURL timing attack
The TempURL middleware in OpenStack Object Storage (Swift) 1.4.6 through 1.8.0, 1.9.0 through 1.10.0, and 1.11.0 allows remote attackers to obtain secret URLs by leveraging an object name and a timing side-channel attack. Signed-off-by: Amy Fong <amy.fong@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-swift')
-rw-r--r--meta-openstack/recipes-devtools/python/python-swift/CVE-2014-0006-swift-1265665.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-swift/CVE-2014-0006-swift-1265665.patch b/meta-openstack/recipes-devtools/python/python-swift/CVE-2014-0006-swift-1265665.patch
new file mode 100644
index 0000000..a284b5b
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-swift/CVE-2014-0006-swift-1265665.patch
@@ -0,0 +1,59 @@
1From b2c61375b3255486adb2900922a894dc7dad3c6d Mon Sep 17 00:00:00 2001
2From: Samuel Merritt <sam@swiftstack.com>
3Date: Thu, 16 Jan 2014 13:44:23 +0100
4Subject: Use constant time comparison in tempURL
5
6Use constant time comparison when evaluating tempURL to avoid timing
7attacks (CVE-2014-0006). This is the havana backport of the master
8patch.
9
10Fixes bug 1265665
11
12Change-Id: I11e4ad83cc4077e52adf54a0bd0f9749294b2a48
13
14diff --git a/swift/common/middleware/tempurl.py b/swift/common/middleware/tempurl.py
15index ffc1431..ae2f4a1 100644
16--- a/swift/common/middleware/tempurl.py
17+++ b/swift/common/middleware/tempurl.py
18@@ -98,7 +98,7 @@ from urlparse import parse_qs
19
20 from swift.proxy.controllers.base import get_account_info
21 from swift.common.swob import HeaderKeyDict
22-from swift.common.utils import split_path
23+from swift.common.utils import split_path, streq_const_time
24
25
26 #: Default headers to remove from incoming requests. Simply a whitespace
27@@ -267,17 +267,20 @@ class TempURL(object):
28 if not keys:
29 return self._invalid(env, start_response)
30 if env['REQUEST_METHOD'] == 'HEAD':
31- hmac_vals = self._get_hmacs(env, temp_url_expires, keys,
32- request_method='GET')
33- if temp_url_sig not in hmac_vals:
34- hmac_vals = self._get_hmacs(env, temp_url_expires, keys,
35- request_method='PUT')
36- if temp_url_sig not in hmac_vals:
37- return self._invalid(env, start_response)
38+ hmac_vals = (self._get_hmacs(env, temp_url_expires, keys,
39+ request_method='GET') +
40+ self._get_hmacs(env, temp_url_expires, keys,
41+ request_method='PUT'))
42 else:
43 hmac_vals = self._get_hmacs(env, temp_url_expires, keys)
44- if temp_url_sig not in hmac_vals:
45- return self._invalid(env, start_response)
46+
47+ # While it's true that any() will short-circuit, this doesn't affect
48+ # the timing-attack resistance since the only way this will
49+ # short-circuit is when a valid signature is passed in.
50+ is_valid_hmac = any(streq_const_time(temp_url_sig, h)
51+ for h in hmac_vals)
52+ if not is_valid_hmac:
53+ return self._invalid(env, start_response)
54 self._clean_incoming_headers(env)
55 env['swift.authorize'] = lambda req: None
56 env['swift.authorize_override'] = True
57--
58cgit v0.10.1
59