RabbitMQ OAuth2 Flaw Lets Anonymous Callers Mint Admin Tokens: What to Patch and Audit
A critical vulnerability in the RabbitMQ management plugin lets an unauthenticated caller who can reach the management port obtain a signed access token from the organization's identity provider, using the broker's own stored OAuth2 client secret. The flaw is tracked as GHSA-cfvg-5q96-8mhm, rated Critical at 9.1 on the CVSS scale, and has no CVE assigned yet. Fixed releases 4.4.1 and 4.3.8 have been out since November 16, so the fix is available, but patching alone does not clean up anything an attacker already created.
The Hacker News reported the flaw on November 30, and the project's advisory went public on November 27. No attacks have been reported so far. Because a proof of concept exists against the official Docker image, teams running OAuth2 login on the management UI should treat this as a same-week patch.
Key Takeaways
- Only deployments with both the management and OAuth2 plugins enabled and a client secret configured for management login are affected.
- Anyone who can reach the management port can ask the broker to request a token on their behalf, with whatever scopes they name.
- Whether that token is administrator-level depends on what your identity provider grants the broker's client.
- A token minted this way also worked over AMQP in the researcher's demo, which exposes queues and messages across virtual hosts.
- Upgrading closes the hole but leaves behind any administrator accounts created through it, so audit users and rotate the client secret.
What is actually broken
The management plugin includes a proxy that forwards token requests from the browser login flow to the identity provider. According to the report, in affected versions the proxy answers callers who never authenticated, adds the broker's stored client secret to requests that lack one, and passes the requested scope through unchanged.
That combination turns the broker into a confused deputy. An anonymous caller sends a token request to the proxy, the broker attaches its own client secret, and the identity provider returns a signed token for the broker's client with the scopes the caller asked for. The caller never needs a username, a password or a signed-in user to trick.
A second write-up by Cyber Security News describes the same behavior: the plugin uses its own stored credentials to request a token without first checking who made the request.
Who is affected
The conditions are narrow but common in production setups that follow the documented OAuth2 guide:
| Condition | Required for exposure |
|---|---|
| Management plugin enabled | Yes |
| OAuth2 plugin enabled | Yes |
| Client secret configured for management login | Yes |
| Attacker can reach the management port | Yes |
| Identity provider grants broker client admin scopes | Needed for full admin access |
The last row matters for risk scoring. The Hacker News notes that what a minted token can do depends on the identity provider, and that full administrator access requires a provider that grants the broker's client administrator scopes. A tightly scoped client reduces the blast radius, but it does not remove the missing authentication check.
Per Cyber Security News, the affected versions are RabbitMQ 4.4.0, 4.3.3 through 4.3.7, and 4.2.9 through 4.2.12, with fixes in 4.4.1, 4.3.8 and 4.2.13. Confirm the branch you run against the project's advisory before you plan the upgrade, because the advisory is the authoritative source for version ranges.
What the researcher demonstrated
The researcher credited as shanz0ng tested the flaw on the official RabbitMQ 4.4.0 management Docker image. According to The Hacker News, the demonstration covered four steps:
- Minting a token with no credentials.
- Confirming the token carried administrator rights.
- Creating a persistent administrator account.
- Logging in over AMQP with the same token.
Step four is the one that widens the incident. A token accepted on AMQP reaches queues and messages across all virtual hosts, not just the management interface. For a message broker that sits between payment, order or telemetry services, that means an attacker could read, forge or delete messages, not only change settings.
The fix
The fix, merged October 22 in pull request 17937, restricts the proxy to the authorization_code and refresh_token grant types that the management login actually uses. Releases containing it shipped on November 16, eleven days before the advisory was published.
That gap is worth noting. If you pin broker versions and update quarterly, you may be on a vulnerable build while a fixed one has been available for two weeks.
What to do this week
- Inventory. Find every RabbitMQ node where the management and OAuth2 plugins are both enabled, and check whether a management client secret is set. Include Docker images and Helm charts, which often pin old tags.
- Reduce exposure first. If you cannot patch today, put an authentication layer in front of the management interface or restrict the management port to a trusted network. Cyber Security News also suggests assessing whether removing the configured OAuth2 client secret would break sign-in.
- Upgrade to 4.4.1, 4.3.8 or 4.2.13 depending on your branch.
- Audit users. List all administrator accounts and look for any you do not recognize. Patching does not delete accounts created through the flaw.
- Review identity provider logs for unusual token issuance to the broker's client, especially requests from the broker host that line up with unauthenticated traffic to the management port.
- Rotate the client secret used for management login, and review which scopes your identity provider grants that client. Give it the least it needs.
- Check queue activity for unexplained consumers, shovels, or deleted queues. The project advises that an exposed management interface does not by itself confirm a breach, so look for evidence rather than assuming either way.
Why this class of bug keeps showing up
This is a missing authentication check on a helper endpoint, added to solve a usability problem in an OAuth2 flow. Convenience proxies in auth flows are a recurring weak spot, because they sit outside the main login path and often skip the checks the main path enforces. They also hold secrets the caller should never be able to borrow.
For defenders, the lesson is practical. Management interfaces for brokers, queues and databases should not be reachable from untrusted networks, and OAuth2 clients attached to infrastructure should carry the narrowest scopes your provider allows. Those two controls turn a 9.1 into a much smaller problem.
For testers, this is a good case to add to an external assessment checklist: enumerate management ports, then check whether helper endpoints respond without credentials. Continuous automated testing of this kind of exposure is the reason we built SecurityInfinity's autonomous pentesting platform, and our guide on why point-in-time pentests fail explains why a flaw disclosed between annual tests can sit unnoticed.
FAQ
Is there a CVE for this RabbitMQ flaw? Not yet. The project tracks it as GHSA-cfvg-5q96-8mhm, and a CVE assignment is pending according to The Hacker News.
Do I need to be logged in to exploit it? No. The attacker needs network access to the management port, not an account, on deployments that use the management OAuth2 login with a client secret.
Does upgrading remove an attacker's access? No. The upgrade stops new tokens from being minted this way, but administrator accounts created earlier remain until you remove them, so audit users and rotate the client secret.
Are there confirmed attacks? No attacks targeting the flaw have been reported at the time of writing, but a public demonstration against the official image exists.
Conclusion
The patch is small and has been available since mid-November. The harder work is the cleanup: find OAuth2-enabled brokers, confirm the management port is not exposed, look for administrator accounts nobody created, and rotate the client secret. Do those four things and you will have closed both the bug and the questions it leaves behind.