CVE-2022-39312: Dataease plugin common MySQL JDBC Deserialization Vulnerability Vulnerability
CRITICALCVE-2022-39312 is a CRITICAL (CVSS 9.8) mysql jdbc deserialization vulnerability vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Dataease plugin common libraries in the Maven ecosystem. The issue involves mysql jdbc deserialization vulnerability. Remediation is available by upgrading affected packages to version 1.15.2.
CVE-2022-39312 at a Glance
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).
How to Fix CVE-2022-39312
To remediate this vulnerability, upgrade all affected Dataease plugin common dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>io.dataease</groupId>
<artifactId>dataease-plugin-common</artifactId>
<version>1.15.2</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=io.dataease
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-39312, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=io.dataease
Analyze the terminal output to locate any version of Dataease plugin common in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.15.2), your application is affected.
Note: The mvn dependency:tree -Dincludes=io.dataease 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 Dataease plugin common, 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
CVE-2022-39312 Affected Dataease plugin common Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
io.dataease:dataease-plugin-common
|
Maven |
< 1.15.2
|
1.15.2
|
References
Frequently Asked Questions
What is CVE-2022-39312?
Which Dataease plugin common versions are affected?
What version fixes CVE-2022-39312?
Is dataease-plugin-common affected?
What is the CVSS score of CVE-2022-39312?
What CWE is associated with CVE-2022-39312?
How can I check Maven dependencies for CVE-2022-39312?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q4qq-jhjv-7rh2",
"modified" : "2022-10-25T20:31:45Z",
"published" : "2022-10-18T18:05:36Z",
"aliases" : [ "CVE-2022-39312" ],
"summary" : "MySQL JDBC deserialization vulnerability",
"details" : "### Impact\n\nIn Dataease, the Mysql data source in the data source function can customize the JDBC connection parameters and the Mysql server target to be connected.\n\n\nIn `backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java`, MysqlConfiguration class don't filter any parameters, directly concat user input.\n```java\n@Getter\n@Setter\npublic class MysqlConfiguration extends JdbcConfiguration {\n\n private String driver = \"com.mysql.jdbc.Driver\";\n private String extraParams = \"characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true&zeroDateTimeBehavior=convertToNull\";\n\n public String getJdbc() {\n if(StringUtils.isEmpty(extraParams.trim())){\n return \"jdbc:mysql://HOSTNAME:PORT/DATABASE\"\n .replace(\"HOSTNAME\", getHost().trim())\n .replace(\"PORT\", getPort().toString().trim())\n .replace(\"DATABASE\", getDataBase().trim());\n }else {\n return \"jdbc:mysql://HOSTNAME:PORT/DATABASE?EXTRA_PARAMS\"\n .replace(\"HOSTNAME\", getHost().trim())\n .replace(\"PORT\", getPort().toString().trim())\n .replace(\"DATABASE\", getDataBase().trim())\n .replace(\"EXTRA_PARAMS\", getExtraParams().trim());\n }\n }\n}\n```\nSo, if the attack add some parameters in JDBC url, and connect to evil mysql server, he can trigger the mysql jdbc deserialization vulnerability, and eventually the attacker can execute through the deserialization vulnerability system commands and obtain server privileges.\n\nAffected versions: < 1.15.2\n\n### Patches\n\nThe vulnerability has been fixed in v1.15.2.\nhttps://github.com/dataease/dataease/blob/6c3a011955c5c753ffd616d030bea5db4793c51c/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java#L19\nthe MysqlConfiguration class use `illegalParameters` filter illegal parameters to fix this vulnerability.\n```\n@Getter\n@Setter\npublic class MysqlConfiguration extends JdbcConfiguration {\n\n private String driver = \"com.mysql.jdbc.Driver\";\n private String extraParams = \"characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true&zeroDateTimeBehavior=convertToNull\";\n private List<String> illegalParameters = Arrays.asList(\"autoDeserialize\", \"queryInterceptors\", \"statementInterceptors\", \"detectCustomCollations\");\n\n public String getJdbc() {\n if (StringUtils.isEmpty(extraParams.trim())) {\n return \"jdbc:mysql://HOSTNAME:PORT/DATABASE\"\n .replace(\"HOSTNAME\", getHost().trim())\n .replace(\"PORT\", getPort().toString().trim())\n .replace(\"DATABASE\", getDataBase().trim());\n } else {\n for (String illegalParameter : illegalParameters) {\n if (getExtraParams().contains(illegalParameter)) {\n throw new RuntimeException(\"Illegal parameter: \" + illegalParameter);\n }\n }\n\n return \"jdbc:mysql://HOSTNAME:PORT/DATABASE?EXTRA_PARAMS\"\n .replace(\"HOSTNAME\", getHost().trim())\n .replace(\"PORT\", getPort().toString().trim())\n .replace(\"DATABASE\", getDataBase().trim())\n .replace(\"EXTRA_PARAMS\", getExtraParams().trim());\n }\n }\n}\n```\n\n### Workarounds\n\nIt is recommended to upgrade the version to v1.15.2.\n\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [https://github.com/dataease/dataease](https://github.com/dataease/dataease)\n* Email us at [wei@fit2cloud.com](mailto:wei@fit2cloud.com)\n",
"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" : "io.dataease:dataease-plugin-common"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.15.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/dataease/dataease/security/advisories/GHSA-q4qq-jhjv-7rh2"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39312"
}, {
"type" : "WEB",
"url" : "https://github.com/dataease/dataease/pull/3328"
}, {
"type" : "WEB",
"url" : "https://github.com/dataease/dataease/commit/956ee2d6c9e81349a60aef435efc046888e10a6d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dataease/dataease"
}, {
"type" : "WEB",
"url" : "https://github.com/dataease/dataease/releases/tag/v1.15.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-502" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-18T18:05:36Z",
"nvd_published_at" : "2022-10-25T17:15:00Z"
}
}