High severityNVD Advisory· Published Dec 18, 2012· Updated Apr 29, 2026
CVE-2012-5563
CVE-2012-5563
Description
OpenStack Keystone, as used in OpenStack Folsom 2012.2, does not properly implement token expiration, which allows remote authenticated users to bypass intended authorization restrictions by creating new tokens through token chaining. NOTE: this issue exists because of a CVE-2012-3426 regression.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
keystonePyPI | < 8.0.0 | 8.0.0 |
Affected products
1Patches
238c7e46a640aEnsure token expiration is maintained (bug 1079216)
2 files changed · +58 −0
keystone/service.py+1 −0 modified@@ -530,6 +530,7 @@ def authenticate(self, context, auth=None): self.token_api.create_token( context, token_id, dict(key=token_id, id=token_id, + expires=auth_token_data['expires'], user=user_ref, tenant=tenant_ref, metadata=metadata_ref))
tests/test_service.py+57 −0 modified@@ -12,10 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. +import time import uuid import default_fixtures +from keystone import config from keystone import exception from keystone import identity from keystone import service @@ -24,6 +26,9 @@ from keystone.openstack.common import timeutils +CONF = config.CONF + + def _build_user_auth(token=None, username=None, password=None, tenant_name=None): """Build auth dictionary. @@ -296,3 +301,55 @@ def test_scoped_remote_authn_invalid_user(self): self.api.authenticate, {'REMOTE_USER': uuid.uuid4().hex}, body_dict) + + +class TokenExpirationTest(test.TestCase): + def setUp(self): + super(TokenExpirationTest, self).setUp() + self.identity_api = kvs_identity.Identity() + self.load_fixtures(default_fixtures) + self.api = service.TokenController() + + def _maintain_token_expiration(self): + """Token expiration should be maintained after re-auth & validation.""" + r = self.api.authenticate( + {}, + auth={ + 'passwordCredentials': { + 'username': self.user_foo['name'], + 'password': self.user_foo['password'] + } + }) + unscoped_token_id = r['access']['token']['id'] + original_expiration = r['access']['token']['expires'] + + time.sleep(0.5) + + r = self.api.validate_token( + dict(is_admin=True, query_string={}), + token_id=unscoped_token_id) + self.assertEqual(original_expiration, r['access']['token']['expires']) + + time.sleep(0.5) + + r = self.api.authenticate( + {}, + auth={ + 'token': { + 'id': unscoped_token_id, + }, + 'tenantId': self.tenant_bar['id'], + }) + scoped_token_id = r['access']['token']['id'] + self.assertEqual(original_expiration, r['access']['token']['expires']) + + time.sleep(0.5) + + r = self.api.validate_token( + dict(is_admin=True, query_string={}), + token_id=scoped_token_id) + self.assertEqual(original_expiration, r['access']['token']['expires']) + + def test_maintain_uuid_token_expiration(self): + self.opt_in_group('signing', token_format='UUID') + self._maintain_token_expiration()
f9d4766249a7Ensure token expiration is maintained
2 files changed · +78 −0
keystone/service.py+1 −0 modified@@ -438,6 +438,7 @@ def authenticate(self, context, auth=None): self.token_api.create_token( context, token_id, dict(key=token_id, id=token_id, + expires=auth_token_data['expires'], user=user_ref, tenant=tenant_ref, metadata=metadata_ref))
tests/test_service.py+77 −0 added@@ -0,0 +1,77 @@ +# Copyright 2012 OpenStack LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import time + +import default_fixtures + +from keystone import config +from keystone import service +from keystone import test +from keystone.identity.backends import kvs as kvs_identity + + +CONF = config.CONF + + +class TokenExpirationTest(test.TestCase): + def setUp(self): + super(TokenExpirationTest, self).setUp() + self.identity_api = kvs_identity.Identity() + self.load_fixtures(default_fixtures) + self.api = service.TokenController() + + def _maintain_token_expiration(self): + """Token expiration should be maintained after re-auth & validation.""" + r = self.api.authenticate( + {}, + auth={ + 'passwordCredentials': { + 'username': self.user_foo['name'], + 'password': self.user_foo['password'] + } + }) + unscoped_token_id = r['access']['token']['id'] + original_expiration = r['access']['token']['expires'] + + time.sleep(0.5) + + r = self.api.validate_token( + dict(is_admin=True, query_string={}), + token_id=unscoped_token_id) + self.assertEqual(original_expiration, r['access']['token']['expires']) + + time.sleep(0.5) + + r = self.api.authenticate( + {}, + auth={ + 'token': { + 'id': unscoped_token_id, + }, + 'tenantId': self.tenant_bar['id'], + }) + scoped_token_id = r['access']['token']['id'] + self.assertEqual(original_expiration, r['access']['token']['expires']) + + time.sleep(0.5) + + r = self.api.validate_token( + dict(is_admin=True, query_string={}), + token_id=scoped_token_id) + self.assertEqual(original_expiration, r['access']['token']['expires']) + + def test_maintain_uuid_token_expiration(self): + self.opt_in_group('signing', token_format='UUID') + self._maintain_token_expiration()
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
17- www.openwall.com/lists/oss-security/2012/11/28/5nvdPatchWEB
- www.openwall.com/lists/oss-security/2012/11/28/6nvdPatchWEB
- secunia.com/advisories/51423nvdVendor Advisory
- secunia.com/advisories/51436nvdVendor Advisory
- github.com/advisories/GHSA-w66p-78g4-mr7gghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2012-5563ghsaADVISORY
- rhn.redhat.com/errata/RHSA-2012-1557.htmlnvdWEB
- www.ubuntu.com/usn/USN-1641-1nvdWEB
- bugs.launchpad.net/keystone/+bug/1079216nvdWEB
- exchange.xforce.ibmcloud.com/vulnerabilities/80370nvdWEB
- github.com/openstack/keystone/commit/38c7e46a640a94da4da89a39a5a1ea9c081f1eb5nvdWEB
- github.com/openstack/keystone/commit/f9d4766249a72d8f88d75dcf1575b28dd3496681nvdWEB
- github.com/pypa/advisory-database/tree/main/vulns/keystone/PYSEC-2012-20.yamlghsaWEB
- web.archive.org/web/20121201003009/http://secunia.com/advisories/51423ghsaWEB
- web.archive.org/web/20140802122732/http://secunia.com/advisories/51436ghsaWEB
- web.archive.org/web/20200228144943/http://www.securityfocus.com/bid/56727ghsaWEB
- www.securityfocus.com/bid/56727nvd
News mentions
0No linked articles in our index yet.