DEV Community

andreagomez
andreagomez

Posted on

RabbitMQ OAuth2 token proxy: anonymous clients can request administrator-scoped tokens

RabbitMQ OAuth2 token proxy: anonymous clients can request administrator-scoped tokens

RabbitMQ's management plugin added an OAuth2 token-endpoint proxy to support its login flow. GHSA-cfvg-5q96-8mhm describes the result in affected versions: the proxy route is reachable without caller authentication, and it forwards caller-controlled form parameters to the identity provider.

The broker becomes a confidential client

When management.oauth_client_secret is configured, the proxy appends that secret to a request that does not include one. It then forwards the request, including scope and grant_type, to the identity provider's token endpoint. On permissive OAuth2 deployments, an anonymous network peer can ask for client-credentials or password grants and receive a signed token with attacker-chosen scope.

The project rates the issue Critical with CVSS 4.0 score 9.1. The advisory says a minted token can work against the management API. It can also be used as the password portion of AMQP 0-9-1 SASL PLAIN authentication. Full administrator access still depends on the identity provider granting the broker's administrator scopes, but that is a common reference configuration.

Affected and fixed versions

Affected ranges are 4.4.0 before 4.4.1, 4.3.3 before 4.3.8, and 4.2.9 before 4.2.13. The fix restricts proxy relaying to authorization_code and refresh_token.

Upgrade the broker and management plugin together. A package upgrade that leaves an old plugin loaded is not complete. Restart the node, verify the plugin version, and test the management login with the intended OAuth2 flow.

Limit the identity provider

The broker's OAuth client should not be allowed to use client_credentials or password grants unless the deployment explicitly requires them. Limit the client's scopes, restrict token audiences, and use identity-provider policy to reject a scope the RabbitMQ management UI never needs.

Review logs for anonymous requests to /js/oidc-oauth/token-endpoint/, unusual grant types, and token endpoint responses followed by management or AMQP activity. Because this is a token-minting path, IP-only indicators may be weak. Correlate the identity-provider subject, client ID, scope, and broker audit events.

Verification

After patching, send a client_credentials request to the proxy with a test client secret that has no privileges and verify that the proxy rejects the grant type. Confirm that the normal authorization-code flow still works and that tokens from the broker client cannot obtain unrelated scopes.

References

Top comments (0)