{"id":"CVE-2022-39312","aliases":["GHSA-q4qq-jhjv-7rh2"],"url":"https://o3.security/vulnerability/CVE-2022-39312","summary":"Dataease Mysql Data Source JDBC Connection Parameters Not Verified Leads to 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![6fc8d5c539807157ee471464b184ab66](https://user-images.githubusercontent.com/13026505/195741851-19f32efb-4391-428a-949f-3d11849f417a.png)\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","published":"2022-10-25T00:00:00Z","modified":"2026-08-12T13:33:12.654648Z","cvss":{"score":9.8,"severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":1,"affectedPackages":[{"ecosystem":"Maven","name":"io.dataease:dataease-plugin-common","fixedVersion":"1.15.2"}],"fix":{"url":"https://github.com/dataease/dataease/commit/956ee2d6c9e81349a60aef435efc046888e10a6d","label":"dataease/dataease@956ee2d"},"references":[{"type":"WEB","url":"https://github.com/dataease/dataease/releases/tag/v1.15.2"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/39xxx/CVE-2022-39312.json"},{"type":"ADVISORY","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":"FIX","url":"https://github.com/dataease/dataease/commit/956ee2d6c9e81349a60aef435efc046888e10a6d"},{"type":"FIX","url":"https://github.com/dataease/dataease/pull/3328"},{"type":"PACKAGE","url":"https://github.com/dataease/dataease"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T13:33:12.654648Z"}}