CVE-2023-37582: Rocketmq namesrv RocketMQ NameServer Component Code Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-gpq8-963w-8qc9
CVSS 9.8
CWE-94
Published
Advisory Summary

CVE-2023-37582 is a CRITICAL (CVSS 9.8) rocketmq nameserver component code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Rocketmq namesrv libraries in the Maven ecosystem. The issue involves rocketmq nameserver component code injection vulnerability. Remediation is available by upgrading affected packages to version 4.9.7, 5.1.2.

CVE-2023-37582 at a Glance

CVE Identifier CVE-2023-37582
GHSA Identifier GHSA-gpq8-963w-8qc9
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Rocketmq namesrv
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-37582

To remediate this vulnerability, upgrade all affected Rocketmq namesrv dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.rocketmq:rocketmq-namesrv fixed: 4.9.7
<dependency>
    <groupId>org.apache.rocketmq</groupId>
    <artifactId>rocketmq-namesrv</artifactId>
    <version>4.9.7</version>
</dependency>
org.apache.rocketmq:rocketmq-namesrv fixed: 5.1.2
<dependency>
    <groupId>org.apache.rocketmq</groupId>
    <artifactId>rocketmq-namesrv</artifactId>
    <version>5.1.2</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.rocketmq

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-37582, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.rocketmq

Analyze the terminal output to locate any version of Rocketmq namesrv in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.9.7), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.rocketmq command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Rocketmq namesrv, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The RocketMQ NameServer component still has a remote command execution vulnerability as the CVE-2023-33246 issue was not completely fixed in version 5.1.1. When NameServer address are leaked on the extranet and lack permission verification, an attacker can exploit this vulnerability by using the update configuration function on the NameServer component to execute commands as the system users that RocketMQ is running as. It is recommended for users to upgrade their NameServer version to 5.1.2 or above for RocketMQ 5.x or 4.9.7 or above for RocketMQ 4.x to prevent these attacks.

CVE-2023-37582 Affected Rocketmq namesrv Versions

2 component(s)
Fixed Versions:
4.9.75.1.2
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.rocketmq:rocketmq-namesrv
Maven
< 4.9.7
4.9.7
org.apache.rocketmq:rocketmq-namesrv
Maven
≥ 5.0.0
< 5.1.2
5.1.2

References

Frequently Asked Questions

What is CVE-2023-37582?
CVE-2023-37582 is a security vulnerability in Rocketmq namesrv involving RocketMQ NameServer component Code Injection vulnerability under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Rocketmq namesrv versions are affected?
Affected versions include releases prior to 4.9.7, 5.1.2 across affected packages: org.apache.rocketmq:rocketmq-namesrv.
What version fixes CVE-2023-37582?
Upgrading to 4.9.7, 5.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rocketmq-namesrv affected?
Yes, org.apache.rocketmq:rocketmq-namesrv is affected in releases prior to 4.9.7, 5.1.2. Upgrade your dependency to 4.9.7, 5.1.2 or later.
What is the CVSS score of CVE-2023-37582?
CVE-2023-37582 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-37582?
CVE-2023-37582 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Maven dependencies for CVE-2023-37582?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.rocketmq'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gpq8-963w-8qc9",
  "modified" : "2025-02-13T19:00:52Z",
  "published" : "2023-07-12T12:31:36Z",
  "aliases" : [ "CVE-2023-37582" ],
  "summary" : "RocketMQ NameServer component Code Injection vulnerability",
  "details" : "The RocketMQ NameServer component still has a remote command execution vulnerability as the CVE-2023-33246 issue was not completely fixed in version 5.1.1. \n\nWhen NameServer address are leaked on the extranet and lack permission verification, an attacker can exploit this vulnerability by using the update configuration function on the NameServer component to execute commands as the system users that RocketMQ is running as. \n\nIt is recommended for users to upgrade their NameServer version to 5.1.2 or above for RocketMQ 5.x or 4.9.7 or above for RocketMQ 4.x to prevent these attacks.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.rocketmq:rocketmq-namesrv"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.9.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.rocketmq:rocketmq-namesrv"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-37582"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/rocketmq"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/m614czxtpvlztd7mfgcs2xcsg36rdbnc"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2023/07/12/1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-12T17:30:39Z",
    "nvd_published_at" : "2023-07-12T10:15:11Z"
  }
}