# CVE-2022-45868: Password exposure in H2 Database

> Local attackers can discover the H2 web admin console password by inspecting process arguments, potentially leading to unauthorized database access.

- **Severity:** High 8.4 (`CVSS:3.1/AC:L/AV:L/A:H/C:H/I:H/PR:N/S:U/UI:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Nov 2022
- **Updated:** 19 Nov 2024
- **Also known as:** CLSA-2026-1786683223, DEBIAN-CVE-2022-45868, GHSA-22wj-vf5f-wrvj, RHLW-2026-7a34ef2db32d7967, ROOT-APP-MAVEN-CVE-2022-45868

## What is CVE-2022-45868?

CVE-2022-45868 is a high-severity vulnerability in n/a, published on 23 Nov 2022. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

The web-based admin console in H2 Database Engine before 2.2.220 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." Nonetheless, the issue was fixed in 2.2.220.

Weakness: CWE-312 (Cleartext Storage of Sensitive Information)

## Which versions are affected by CVE-2022-45868?

2 open source packages ship an affected version, including com.h2database:h2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `com.h2database:h2` | Maven | From 1.4.198 | 2.2.220 |
| `com.h2database:h2` | Maven | From 1.4.198 | 2.2.220 |

Products: H2database H2.

## How do I fix CVE-2022-45868?

Upgrade com.h2database:h2 to 2.2.220 or later.

## Is CVE-2022-45868 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-45868 exists.

## Other vulnerabilities in n/a

- [CVE-2021-23463](https://insights.sbomify.com/CVE-2021-23463/): XML External Entity (XXE) Injection (high 8.1)
- [CVE-2018-14335](https://insights.sbomify.com/CVE-2018-14335/): Path traversal in n/a (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-45868 and fix it if it is affected.

What it is: CVE-2022-45868 is a high-severity vulnerability in n/a, published on 23 Nov 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-45868 exists.

Affected packages and fixed versions:
- com.h2database:h2 (Maven): affected from 1.4.198; fixed in 2.2.220
- com.h2database:h2 (Maven): affected from 1.4.198; fixed in 2.2.220

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-45868/ (Markdown: https://insights.sbomify.com/CVE-2022-45868/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-45868
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-45868
- OSV: https://osv.dev/vulnerability/CVE-2022-45868

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-45868/
Summaries are generated and may contain mistakes; the official description above is the record.
