CVE-2023-28754: Shardingsphere Apache ShardingSphere-Agent Deserialization Of Untrusted Vulnerability

HIGH
Advisory Identifier: GHSA-3cxh-xp3g-jxjm
CVSS 8.8
CWE-502
Published
Advisory Summary

CVE-2023-28754 is a HIGH (CVSS 8.8) apache shardingsphere-agent deserialization of untrusted vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Shardingsphere libraries in the Maven ecosystem. The issue involves apache shardingsphere-agent deserialization of untrusted data vulnerability. Remediation is available by upgrading affected packages to version 5.4.0.

CVE-2023-28754 at a Glance

CVE Identifier CVE-2023-28754
GHSA Identifier GHSA-3cxh-xp3g-jxjm
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Shardingsphere
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
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-28754

To remediate this vulnerability, upgrade all affected Shardingsphere 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.shardingsphere:shardingsphere fixed: 5.4.0
<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>shardingsphere</artifactId>
    <version>5.4.0</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.shardingsphere

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.apache.shardingsphere 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Shardingsphere, 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

Deserialization of Untrusted Data vulnerability in Apache ShardingSphere-Agent, which allows attackers to execute arbitrary code by constructing a special YAML configuration file. The attacker needs to have permission to modify the ShardingSphere Agent YAML configuration file on the target machine, and the target machine can access the URL with the arbitrary code JAR. An attacker can use SnakeYAML to deserialize java.net.URLClassLoader and make it load a JAR from a specified URL, and then deserialize javax.script.ScriptEngineManager to load code using that ClassLoader. When the ShardingSphere JVM process starts and uses the ShardingSphere-Agent, the arbitrary code specified by the attacker will be executed during the deserialization of the YAML configuration file by the Agent. This issue affects ShardingSphere-Agent: through 5.3.2. This vulnerability is fixed in Apache ShardingSphere 5.4.0.

CVE-2023-28754 Affected Shardingsphere Versions

1 component(s)
Fixed Versions:
5.4.0
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.shardingsphere:shardingsphere
Maven
< 5.4.0
5.4.0

References

Frequently Asked Questions

What is CVE-2023-28754?
CVE-2023-28754 is a security vulnerability in Shardingsphere involving Apache ShardingSphere-Agent Deserialization of Untrusted Data vulnerability under CWE-502: Deserialization of Untrusted Data.
Which Shardingsphere versions are affected?
Affected versions include releases prior to 5.4.0 across affected packages: org.apache.shardingsphere:shardingsphere.
What version fixes CVE-2023-28754?
Upgrading to 5.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is shardingsphere affected?
Yes, org.apache.shardingsphere:shardingsphere is affected in releases prior to 5.4.0. Upgrade your dependency to 5.4.0 or later.
What is the CVSS score of CVE-2023-28754?
CVE-2023-28754 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-28754?
CVE-2023-28754 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Maven dependencies for CVE-2023-28754?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.shardingsphere'. 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-3cxh-xp3g-jxjm",
  "modified" : "2023-07-28T21:34:04Z",
  "published" : "2023-07-19T09:30:54Z",
  "aliases" : [ "CVE-2023-28754" ],
  "summary" : "Apache ShardingSphere-Agent Deserialization of Untrusted Data vulnerability",
  "details" : "Deserialization of Untrusted Data vulnerability in Apache ShardingSphere-Agent, which allows attackers to execute arbitrary code by constructing a special YAML configuration file.\n\nThe attacker needs to have permission to modify the ShardingSphere Agent YAML configuration file on the target machine, and the target machine can access the URL with the arbitrary code JAR.\nAn attacker can use SnakeYAML to deserialize java.net.URLClassLoader and make it load a JAR from a specified URL, and then deserialize javax.script.ScriptEngineManager to load code using that ClassLoader. When the ShardingSphere JVM process starts and uses the ShardingSphere-Agent, the arbitrary code specified by the attacker will be executed during the deserialization of the YAML configuration file by the Agent.\n\nThis issue affects ShardingSphere-Agent: through 5.3.2. This vulnerability is fixed in Apache ShardingSphere 5.4.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.shardingsphere:shardingsphere"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.3.2"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-28754"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/shardingsphere"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/p8onhqox5kkwow9lc6gs03z28wtyp1cg"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2023/07/19/3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-20T10:10:02Z",
    "nvd_published_at" : "2023-07-19T08:15:10Z"
  }
}