CVE-2022-45868: H2 Password Exposure Vulnerability
HIGHCVE-2022-45868 is a HIGH (CVSS 7.8) password exposure vulnerability (CWE-312: Cleartext Storage of Sensitive Information) affecting H2 libraries in the Maven ecosystem. The issue involves password exposure in h2 database. Remediation is available by upgrading affected packages to version 2.2.220.
CVE-2022-45868 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-45868
To remediate this vulnerability, upgrade all affected H2 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>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.2.220</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=com.h2database
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-45868, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=com.h2database
Analyze the terminal output to locate any version of H2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.220), your application is affected.
Note: The mvn dependency:tree -Dincludes=com.h2database 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-312: Cleartext Storage of Sensitive Information, where the product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. In H2, 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-45868 Affected H2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
com.h2database:h2
|
Maven |
≥ 1.4.198
< 2.2.220
|
2.2.220
|
References
Frequently Asked Questions
What is CVE-2022-45868?
Which H2 versions are affected?
What version fixes CVE-2022-45868?
Is h2 affected?
What is the CVSS score of CVE-2022-45868?
What CWE is associated with CVE-2022-45868?
How can I check Maven dependencies for CVE-2022-45868?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-22wj-vf5f-wrvj",
"modified" : "2024-07-03T17:59:02Z",
"published" : "2022-11-23T21:30:31Z",
"aliases" : [ "CVE-2022-45868" ],
"summary" : "Password exposure in H2 Database ",
"details" : "The web-based admin console in H2 Database Engine through 2.1.214 can be started via the CLI with the argument -webAdminPassword, which allows the user to specify the password in cleartext for the web admin console. Consequently, a local user (or an attacker that has obtained local access through some means) would be able to discover the password by listing processes and their arguments. NOTE: the vendor states \"This is not a vulnerability of H2 Console ... Passwords should never be passed on the command line and every qualified DBA or system administrator is expected to know that.\"",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "com.h2database:h2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.4.198"
}, {
"fixed" : "2.2.220"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-45868"
}, {
"type" : "WEB",
"url" : "https://github.com/h2database/h2database/issues/3686"
}, {
"type" : "WEB",
"url" : "https://github.com/h2database/h2database/pull/3833"
}, {
"type" : "WEB",
"url" : "https://github.com/h2database/h2database/commit/581ed18ff9d6b3761d851620ed88a3994a351a0d"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-22wj-vf5f-wrvj"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/h2database/h2database"
}, {
"type" : "WEB",
"url" : "https://github.com/h2database/h2database/blob/96832bf5a97cdc0adc1f2066ed61c54990d66ab5/h2/src/main/org/h2/server/web/WebServer.java#L346-L347"
}, {
"type" : "WEB",
"url" : "https://github.com/h2database/h2database/releases/tag/version-2.2.220"
}, {
"type" : "WEB",
"url" : "https://sites.google.com/sonatype.com/vulnerabilities/sonatype-2022-6243"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200", "CWE-312" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-11-23T22:31:05Z",
"nvd_published_at" : "2022-11-23T21:15:00Z"
}
}