You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AS admin: DELETE /admin/oauth2/tokens/{tokenId} puts the access token value in the URL, where access logs keep it #360
Found by the round-1 /code-review high of PR #359 (#344 part 3a). It was there before that PR.
Problem
DELETE /admin/oauth2/tokens/{tokenId} (OAuthAdminController.revokeToken) takes the live access token value in the URL path. Request paths are routinely kept by reverse proxies, load balancers, Tomcat or Spring access logs and browser history, so revoking a token through this endpoint can leave the token value in plain text in logs. Access tokens must never be logged or saved.
PR #359 stopped the response from echoing the token, but the URL still carries it.
Failure scenario
An administrator revokes a token with DELETE /admin/oauth2/tokens/<opaque-access-token>. The reverse proxy and the access log record the full path, and the token value is kept in plain text, possibly until it would have expired anyway or longer.
Fix
Take the token in the request body, as RFC 7009's /oauth2/revoke does: for example POST /admin/oauth2/tokens/revoke with a form or JSON token parameter. Remove the path form. Alternatively, revoke by authorization id, which is not a credential. Update the docs and tests.
Planned for #344 part 3b, with the API docs (#343). Must be done before deployment.
Activity