Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

added a new parameter to the openid configuration section in config.y… #3

Open
wants to merge 1 commit into
base: opendistro-0.10
Choose a base branch
from

Conversation

m4rkw
Copy link

@m4rkw m4rkw commented Apr 30, 2021

Hello,

We have discovered a security flaw in the OpenDistro OIDC implementation in that the aud (audience) claim is not validated when the access token is a JWT.

This effectively means it is making an assumption that the OIDC JWT provider is wholly private, i.e. no JWT will be signed by that provider intended for any service other than Elasticsearch.

This is of course untrue with an enterprise OIDC login system that supports multiple applications.

Because of this, any application running in the organisation can receive a JWT token (destined for a completely different application) and use it to impersonate the user to Elasticsearch, without their knowledge.

This pull request contains our suggested fix for OpenDistro 0.10.

This issue is likely also present in later versions of OpenDistro so ideally this fix would be forward-ported to the newer versions that are compatible with Elasticsearch 7+.

This adds a new optional parameter "audiences" to the openid configuration block in config.yml. This can be set to a list of valid audiences. If this is set then the JWT must contain at least one of the configured valid audience strings, if it doesn't then the JWT is considered invalid and authentication is denied. If the audiences parameter is unset then the behaviour is the same as it is now, i.e. the aud claim is not validated.

Credit to Max Bowsher for highlighting this issue to us.

Thanks,
Mark

…ml: audiences

audiences is a list of valid audiences for a JWT token. If set to a list of strings
then the JWT aud claim must match one of the configured audiences. if this is not the
case then the JWT is considered invalid and authetication is denied.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant