Swift object/proxy server writing Auth Token to log file (swauth)

Bug #1655781 reported by Rahul U Nair on 2017-01-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
OpenStack Security Advisory
Swift Authentication
Pavel Kvasnička

Bug Description

Auth tokens logged by proxy and object server if the swauth[1] authentication middleware is used.

Swift object store and proxy server is saving tokens retrieved from middleware authentication mechanism (swauth) to log file

Steps to trigger the issue:

1. Enable `swauth` authentication middleware
2. Retieve token using:

swift -A -U test:tester -K testing stat -v

Logs written when the above command is excecuted has the token as well:

Jan 11 22:51:22 ubuntu-xenial object-6030: - - [11/Jan/2017:22:51:22 +0000] "GET /sdb3/660/AUTH_.auth/.token_0/AUTH_tkc9ccde1d34c44c82ac1d260ddbd18df0" 200 194 "GET" "txfbebdc4d5b7f48b285132-005876b6ea" "proxy-server 31555" 0.0152 "-" 28646 0
Jan 11 22:51:22 ubuntu-xenial proxy-server: - - 11/Jan/2017/22/51/22 GET /v1/AUTH_.auth/.token_0/AUTH_tkc9ccde1d34c44c82ac1d260ddbd18df0 HTTP/1.0 200 - python-swiftclient-3.2.1.dev9%20Swauth - - 194 - txfbebdc4d5b7f48b285132-005876b6ea - 0.1124 SWTH - 1484175082.315428972 1484175082.427867889 0
Jan 11 22:51:22 ubuntu-xenial object-6030: STDERR: - - [11/Jan/2017 22:51:22] "GET /sdb3/660/AUTH_.auth/.token_0/AUTH_tkc9ccde1d34c44c82ac1d260ddbd18df0 HTTP/1.1" 200 579 0.028552 (txn: txfbebdc4d5b7f48b285132-005876b6ea)

3. After retrieving the token from the logfile, I was able to execute this command as below,

curl -i -X GET -H "Accept-Encoding: gzip" -H "X-Auth-Token: AUTH_tkc9ccde1d34c44c82ac1d260ddbd18df0"

The output obtained:

HTTP/1.1 200 OK
Content-Length: 2
Accept-Ranges: bytes
X-Timestamp: 1484167500.58887
X-Account-Bytes-Used: 0
X-Account-Container-Count: 0
Content-Type: application/json; charset=utf-8
X-Account-Object-Count: 0
X-Trans-Id: txbd83d5254a404647bb086-005876ba2a
X-Openstack-Request-Id: txbd83d5254a404647bb086-005876ba2a
Date: Wed, 11 Jan 2017 23:05:14 GMT

As, swift has the ability to add any middleware for authentication, swauth is officially part of OpenStack project[1], the token should not be logged. I suspect this issue would be there for any authentication middleware and is a security issue.

[1]. https://github.com/openstack/swauth

CVE References

Jeremy Stanley (fungi) wrote :

Since this report concerns a possible security risk, an incomplete security advisory task has been added while the core security reviewers for the affected project or projects confirm the bug and discuss the scope of any vulnerability along with potential solutions.

description: updated
Changed in ossa:
status: New → Incomplete
Jeremy Stanley (fungi) wrote :

Minor correction to the bug description: swauth is not a deliverable of any official OpenStack project team, it merely shares our Git namespace because its development is hosted within our community infrastructure. We extend use of our developer community infrastructure to any projects within our ecosystem who wish to make use of the same workflows and hosting provided to official OpenStack software.

Jeremy Stanley (fungi) wrote :

I've added swauth as an affected project on this report, hoping their bug team might have some feedback.

Ondřej Nový (onovy) wrote :

Swauth stores tokens directly in swift (in object AUTH_.auth/.token_0/AUTH_tkc9ccde1d34c44c82ac1d260ddbd18df0). I think other auth middlewares are not affected.

Only solution is to hash token again before storing them in Swift. I will look into it.

Ondřej Nový (onovy) on 2017-11-06
Changed in swauth:
assignee: nobody → Pavel Kvasnička (pavel-kvasnicka)
status: New → In Progress
Ondřej Nový (onovy) wrote :


Ondřej Nový (onovy) on 2017-11-21
information type: Private Security → Public Security
Ondřej Nový (onovy) wrote :
Changed in swauth:
importance: Undecided → High
Changed in swauth:
status: In Progress → Confirmed
status: Confirmed → In Progress
Jeremy Stanley (fungi) on 2017-11-21
description: updated
Changed in ossa:
status: Incomplete → Won't Fix
Jeremy Stanley (fungi) wrote :

I've gone ahead and marked the OpenStack Security Advisory task to Won't Fix. Since swauth isn't an official OpenStack deliverable, this is probably closest to report class C2 for the OpenStack VMT (A vulnerability, but not in OpenStack supported code, e.g., in a dependency): https://security.openstack.org/vmt-process.html#incident-report-taxonomy

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

Other bug subscribers

Remote bug watches

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