Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

TokenRequestValidator.LogWithRequestDetails may leak RefreshToken #4883

Closed
mustakimali opened this issue Sep 15, 2020 · 1 comment
Closed

Comments

@mustakimali
Copy link
Contributor

mustakimali commented Sep 15, 2020

Issue / Steps to reproduce the problem

If refresh_token is configured to be scrubbed like this

services.AddIdentityServer(options =>
                {
                    // ...
                    options.Logging.TokenRequestSensitiveValuesFilter = new List<string>{ "client_secret", "refresh_token"};
                })

however due to how the TokenRequestValidationLog constructor also sets the RefreshToken property

Raw = request.Raw.ToScrubbedDictionary(sensitiveValuesFilter.ToArray());
if (request.Client != null)
{
ClientId = request.Client.ClientId;
ClientName = request.Client.ClientName;
}
if (request.RequestedScopes != null)
{
Scopes = request.RequestedScopes.ToSpaceSeparatedString();
}
GrantType = request.GrantType;
AuthorizationCode = request.AuthorizationCodeHandle;
RefreshToken = request.RefreshTokenHandle;

This means LogSuccess Here will eventually log the RefreshToken.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants