CVE-2020-1947: Shardingsphere Deserialization Of Untrusted Data Vulnerability

HIGH
Advisory Identifier: GHSA-v54f-xcmp-43cr
CVSS 9.8
CWE-502
Published
Advisory Summary

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

CVE-2020-1947 at a Glance

CVE Identifier CVE-2020-1947
GHSA Identifier GHSA-v54f-xcmp-43cr
Severity HIGH
CVSS v3.1 Base Score 9.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Shardingsphere
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-2020-1947

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: 4.0.1
<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>shardingsphere</artifactId>
    <version>4.0.1</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-2020-1947, 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 4.0.1), 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

In Apache ShardingSphere(incubator) 4.0.0-RC3 and 4.0.0, the ShardingSphere&#39;s web console uses the SnakeYAML library for parsing YAML inputs to load datasource configuration. SnakeYAML allows to unmarshal data to a Java type By using the YAML tag. Unmarshalling untrusted data can lead to security flaws of RCE.

CVE-2020-1947 Affected Shardingsphere Versions

1 component(s)
Fixed Versions:
4.0.1
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.shardingsphere:shardingsphere
Maven
≥ 4.0.0-RC3
< 4.0.1
4.0.1

References

Frequently Asked Questions

What is CVE-2020-1947?
CVE-2020-1947 is a security vulnerability in Shardingsphere involving Deserialization of Untrusted Data in Apache ShardingSphere under CWE-502: Deserialization of Untrusted Data.
Which Shardingsphere versions are affected?
Affected versions include releases prior to 4.0.1 across affected packages: org.apache.shardingsphere:shardingsphere.
What version fixes CVE-2020-1947?
Upgrading to 4.0.1 (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 4.0.1. Upgrade your dependency to 4.0.1 or later.
What is the CVSS score of CVE-2020-1947?
CVE-2020-1947 has a CVSS v3.1 base score of 9.8 (HIGH) 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-2020-1947?
CVE-2020-1947 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-2020-1947?
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-v54f-xcmp-43cr",
  "modified" : "2021-04-26T14:48:19Z",
  "published" : "2022-02-10T20:39:47Z",
  "aliases" : [ "CVE-2020-1947" ],
  "summary" : "Deserialization of Untrusted Data in Apache ShardingSphere",
  "details" : "In Apache ShardingSphere(incubator) 4.0.0-RC3 and 4.0.0, the ShardingSphere&#39;s web console uses the SnakeYAML library for parsing YAML inputs to load datasource configuration. SnakeYAML allows to unmarshal data to a Java type By using the YAML tag. Unmarshalling untrusted data can lead to security flaws of RCE.",
  "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.shardingsphere:shardingsphere"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0-RC3"
      }, {
        "fixed" : "4.0.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.0.0"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-1947"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r4a61a24c119bd820da6fb02100d286f8aae55c8f9b94a346b9bb27d8%40%3Cdev.shardingsphere.apache.org%3E"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-04-26T14:48:19Z",
    "nvd_published_at" : "2020-03-11T21:15:00Z"
  }
}