# CVE-2023-33246: Apache RocketMQ Command Execution

> Attackers can execute arbitrary commands on Apache RocketMQ servers if components are exposed without authentication, requiring an upgrade to secure versions.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 6 Sep 2023 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 May 2023
- **Updated:** 21 Oct 2025
- **Also known as:** GHSA-x3cq-8f32-5f63

## What is CVE-2023-33246?

CVE-2023-33246 is a critical command injection vulnerability in Apache RocketMQ, published on 24 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

For RocketMQ versions 5.1.0 and below, under certain conditions, there is a risk of remote command execution. 

Several components of RocketMQ, including NameServer, Broker, and Controller, are leaked on the extranet and lack permission verification, an attacker can exploit this vulnerability by using the update configuration function to execute commands as the system users that RocketMQ is running as. Additionally, an attacker can achieve the same effect by forging the RocketMQ protocol content. 

To prevent these attacks, users are recommended to upgrade to version 5.1.1 or above for using RocketMQ 5.x or 4.9.6 or above for using RocketMQ 4.x .

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2023-33246?

8 open source packages ship an affected version, including org.apache.rocketmq:rocketmq-namesrv, org.apache.rocketmq:rocketmq-broker and org.apache.rocketmq:rocketmq-controller. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.rocketmq:rocketmq-namesrv` | Maven | From 4.0.0 | 4.9.6 |
| `org.apache.rocketmq:rocketmq-namesrv` | Maven | From 4.0.0 | 4.9.6 |
| `org.apache.rocketmq:rocketmq-namesrv` | Maven | From 5.0.0 | 5.1.1 |
| `org.apache.rocketmq:rocketmq-namesrv` | Maven | From 5.0.0 | 5.1.1 |
| `org.apache.rocketmq:rocketmq-broker` | Maven | From 5.0.0 | 5.1.1 |
| `org.apache.rocketmq:rocketmq-broker` | Maven | From 5.0.0 | 5.1.1 |
| `org.apache.rocketmq:rocketmq-controller` | Maven | From 5.0.0 | 5.1.1 |
| `org.apache.rocketmq:rocketmq-controller` | Maven | From 5.0.0 | 5.1.1 |

Products: Apache Rocketmq.

## How do I fix CVE-2023-33246?

Upgrade org.apache.rocketmq:rocketmq-namesrv to a fixed version for your release line: 4.9.6 or 5.1.1. US federal agencies must fix it by 27 Sep 2023.

## Is CVE-2023-33246 being exploited?

Yes. Attackers have exploited CVE-2023-33246 in the wild since at least 6 Sep 2023.

Public exploit code:

- Apache RocketMQ 远程代码执行漏洞(CVE-2023-33246) Exploit (github_poc): https://github.com/SuperZero/CVE-2023-33246
- CVE-2023-33246 RocketMQ RCE Detect By Version and Exploit (github_poc): https://github.com/Malayke/CVE-2023-33246_RocketMQ_RCE_EXPLOIT
- Apache RocketMQ 远程代码执行漏洞(CVE-2023-33246) Exploit (github_poc): https://github.com/Le1a/CVE-2023-33246
- https://github.com/I5N0rth/CVE-2023-33246 (github_poc): https://github.com/I5N0rth/CVE-2023-33246
- A go-exploit for fetching the RocketMQ broker configuration in order to discover indicators of compromise for CVE-2023-33246 (github_poc): https://github.com/vulncheck-oss/fetch-broker-conf
- https://github.com/4mazing/CVE-2023-33246-Copy (github_poc): https://github.com/4mazing/CVE-2023-33246-Copy

## Other vulnerabilities in Apache RocketMQ

- [CVE-2023-37582](https://insights.sbomify.com/CVE-2023-37582/): Apache RocketMQ: Possible remote code execution when using the update configuration function (critical 9.8)
- [CVE-2024-23321](https://insights.sbomify.com/CVE-2024-23321/): Apache RocketMQ: Unauthorized Exposure of Sensitive Data (high 7.5)
- [CVE-2019-17572](https://insights.sbomify.com/CVE-2019-17572/): Directory traversal in Apache RocketMQ (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-33246 and fix it if it is affected.

What it is: CVE-2023-33246 is a critical command injection vulnerability in Apache RocketMQ, published on 24 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2023-33246 in the wild since at least 6 Sep 2023.

Affected packages and fixed versions:
- org.apache.rocketmq:rocketmq-namesrv (Maven): affected from 4.0.0; fixed in 4.9.6
- org.apache.rocketmq:rocketmq-namesrv (Maven): affected from 4.0.0; fixed in 4.9.6
- org.apache.rocketmq:rocketmq-namesrv (Maven): affected from 5.0.0; fixed in 5.1.1
- org.apache.rocketmq:rocketmq-namesrv (Maven): affected from 5.0.0; fixed in 5.1.1
- org.apache.rocketmq:rocketmq-broker (Maven): affected from 5.0.0; fixed in 5.1.1
- org.apache.rocketmq:rocketmq-broker (Maven): affected from 5.0.0; fixed in 5.1.1
- org.apache.rocketmq:rocketmq-controller (Maven): affected from 5.0.0; fixed in 5.1.1
- org.apache.rocketmq:rocketmq-controller (Maven): affected from 5.0.0; fixed in 5.1.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-33246/ (Markdown: https://insights.sbomify.com/CVE-2023-33246/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-33246
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-33246
- OSV: https://osv.dev/vulnerability/CVE-2023-33246

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-33246/
Summaries are generated and may contain mistakes; the official description above is the record.
