CVE-2022-23221: Arbitrary code execution in H2 Console
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.96183%
CWE
Published
1/21/2022
Updated
8/18/2023
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
com.h2database:h2 | maven | < 2.1.210 | 2.1.210 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper handling of JDBC URL parameters in H2 Console. The WebServer.getConnection()
method processes attacker-controlled inputs, enabling dangerous configurations that bypass security restrictions. ConnectionInfo.readSettingsFromURL()
parses and applies these parameters, allowing INIT=RUNSCRIPT to execute untrusted scripts. The patch in 2.1.210 specifically addresses these areas (PR #3377), confirming their role in the exploit chain. The CWE-88 classification and PoC using INIT=RUNSCRIPT to load remote SQL scripts further validate this analysis.