OSSN-0006: Keystone can allow user impersonation when using REMOTE_USER for external authentication

Summary

When external authentication is used with Keystone using the ExternalDefault plug-in, external usernames containing “@” characters are truncated at the “@” character before being mapped to a local Keystone user. This can result in separate external users mapping to the same local Keystone user, which could lead to user impersonation.

Affected Services / Software

Keystone, Havana

Discussion

When Keystone is run in the Apache HTTP Server, the webserver can handle authentication and pass the authenticated username to Keystone using the REMOTE_USER environment variable. External authentication behavior is handled by authentication plugins in Keystone. In the Havana release of OpenStack, if the external username provided in the REMOTE_USER environment variable contains an “@” character Keystone will only use the portion preceding the “@” character as the username when using the ExternalDefault authentication plugin. This results in the ability for multiple unique external usernames to map to the same single username in Keystone. For example, the external usernames “jdoe@example1.com” and “jdoe@example2.com” would both map to the Keystone user “jdoe”. This behavior could potentially be abused to allow one to impersonate another similarly named external user.

Keystone in OpenStack releases prior to Havana uses the entire value contained in the REMOTE_USER environment variable, so those versions are not vulnerable to this impersonation issue.

Contacts / References

Author: Nathan Kinder, Red Hat