Trust scoped tokens leak domain information about a role

Bug #1763510 reported by Lance Bragstad
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
In Progress
Low
wangxiyuan

Bug Description

When getting tokens from keystone, the response will contain a token body. One of the attributes of the token response is a list of roles that correspond to the scope of the token (e.g. roles for a project, or domain, etc.)

Traditionally, the list of roles only consists of two pieces of information about each role, the `id` and the `name`. During the implementation of domain-specific roles, the token provider API was modified to handle those cases [0]. The result is that when you get a trust scoped token, the list of roles actually includes the `domain_id`, too. This is because the token provider API copies the role reference from the role API directly into the token response [1], instead of only using the `id` and `name` attributes.

The good this is that this is only done when the role's domain_id == None, which means we're not leaking any sensitive information about domain-specific roles. The bad thing is that it doesn't really present any useful information and if 'domain_id' is in the role reference it's always None. This results in trust-scoped tokens having different responses than other token formats. It also opens up the ability for more data leakage in the event we ever expand the role entity to include another attribute.

This was uncovered in a patch to make parts of our JSONschema testing more DRY [2].

[0] https://review.openstack.org/#/c/263064/19
[1] https://github.com/openstack/keystone/blob/694ef627dd5a544b8200703fa4a42220d6f4784c/keystone/token/providers/common.py#L393-L394
[2] https://review.openstack.org/#/c/407587/1

description: updated
Changed in keystone:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Lance Bragstad (lbragstad) wrote :

Note that a fix for this is going to be backwards incompatible, even though the patch the introduced the issue technically was backwards incompatible.

We should consult the TC about fixing this or wait until we have microversion support.

tags: added: fix-requires-microversion
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/561061

Changed in keystone:
assignee: nobody → Lance Bragstad (lbragstad)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to keystone (master)

Reviewed: https://review.openstack.org/407587
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=96a883a5ad37a922218b6d33eec7baa206622620
Submitter: Zuul
Branch: master

commit 96a883a5ad37a922218b6d33eec7baa206622620
Author: Brant Knudson <email address hidden>
Date: Tue Dec 6 10:09:25 2016 -0600

    Use consistent role schema in token response validation

    The tests used a different schema for the roles in the token
    response schema for different token scopes. The role information
    shouldn't change depending on the scope, so let's make the test
    more DRY by not redefining the role schema in multiple places.

    Related-Bug: 1763510
    Change-Id: I58d3dc2a3306994890688d5ff40a62cdaedf378e

Changed in keystone:
milestone: none → rocky-rc1
Changed in keystone:
assignee: Lance Bragstad (lbragstad) → wangxiyuan (wangxiyuan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by "Lance Bragstad <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/keystone/+/561061
Reason: I'm going to abandon this since I don't have the cycles to clean this up. If/when another API version happens, this can be considered then.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.