Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Missing validation of OIDC tokens #92

Open
FBasels opened this issue May 25, 2021 · 5 comments
Open

[BUG] Missing validation of OIDC tokens #92

FBasels opened this issue May 25, 2021 · 5 comments
Labels

Comments

@FBasels
Copy link

FBasels commented May 25, 2021

  1. Summary - Tokens are not validated in any way during agent authentication. Thus, a service accept access tokens that are issued for another service.

  2. Bug Details - A detailed explanation of the issue, structured in subsections:

    1. What? - Tokens from the OIDC provider are not validated, when authenticating an agent
    2. Where? - AuthenticationManager in the las2peer webconnector
    3. When?/How often? -
    4. How?/Current state - As far as I can see the token is only "validated" during the agent authentication (by requesting the userinfo from the OIDC provider) if the agent does not exist at the moment . However it is never checked if the token was issued to this service and not to a different one.
@FBasels FBasels added the bug label May 25, 2021
@ThoreKr
Copy link
Contributor

ThoreKr commented May 26, 2021

Ideally it would honor the audience and authorized party and check if these match the given configuration.

This would require the client id to be known to the authentication manager.

@FBasels
Copy link
Author

FBasels commented May 27, 2021

But these steps are done with the ID token, currently the authenticationManager uses the access token. Correct me if I am missing something, but if we have the ID token, we do not need the access token here anymore, since it is only used to send a request to the /userinfo endpoint. These information are already given in the ID token.

@ThoreKr
Copy link
Contributor

ThoreKr commented May 27, 2021

This is probably blurred, due to the way the authentication is currently botched up.
Before the switch to basic auth the token is used for authentication without further validation.

If you look at the tokens sent by cae or requirements bazaar these are also id tokens.

However, if i understood correctly, the token is nothing more than a weird way of prefilling a registration form, Is - this strictly speaking - authentication or authorization?

@FBasels
Copy link
Author

FBasels commented Jul 6, 2021

As you said, the token is used for getting the preferred_username of the user and use it as username for the UserAgent. So you could say it is used for authentication, not authorization, but only in the case a UserAgent could not be found with the credentials that were send in the request. So if a user already exist/a user could be found with the credentials, the token is not used at all.
So we only have to have a look at the creation of a new UserAgent with the tokens, or am I missing something?

To verify the token, the authenticationManager (or the Webconnector in general) would need to know the clientIds of the services that sends the request. It would not make sense if the service would send the id within the request as header or something.

@ThoreKr
Copy link
Contributor

ThoreKr commented Jul 6, 2021

Hm. Probably it doesn't make sense to tackle this right now.

It is a security issue in 0.7 (which is still used by reqbaz prod), and technically currently is, but the authentication right now is anything but secure anyways (probably that claim should be removed from the website).

It would not make sense if the service would send the id within the request as header or something.

Technically this information is included in the token (aud claim), even the issuer header is unnessesary, since there is an iss claim.

Maybe the best way forward is to close this in favour of #96 and #95. and add the supported audiences to the configuration parameters or in the application registration and do validation from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants