Skip to content

AS admin: DELETE /admin/oauth2/tokens/{tokenId} puts the access token value in the URL, where access logs keep it #360

Done

Description

@dfcoffin

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.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions