Open
fix CVE-2022-23221: disable H2 Console #20
Tian-FantaseaAdd on Aug 28
fix CVE-2022-23221: disable H2 Console #20
Open
Merged fromTian-Fantasea/h2fix/CVE-2022-23221intosrc-openeuler/h2master
Total: 2 files changed+38-1
| @@ -0,0 +1,32 @@ | |||
| 1 | +From: openEuler CVE fix | ||
| 2 | +Date: 2026-08-28 | ||
| 3 | +Subject: [PATCH] Disable H2 Console to mitigate CVE-2022-23221 | ||
| 4 | + | ||
| 5 | +CVE-2022-23221: H2 Console before 2.1.210 allows remote attackers to execute | ||
| 6 | +arbitrary code via a jdbc:h2:mem JDBC URL containing | ||
| 7 | +IGNORE_UNKNOWN_SETTINGS=TRUE;FORBID_CREATION=FALSE;INIT=RUNSCRIPT. | ||
| 8 | + | ||
| 9 | +The H2 Console is a developer tool and not required by any reverse-dependency | ||
| 10 | +in openEuler. Disabling its launcher eliminates the remote attack surface. | ||
| 11 | +This mirrors Debian's mitigation shipped in DSA-5076-1 (h2database | ||
| 12 | +1.4.197-4+deb11u1). Upstream proper fix requires H2 >= 2.1.210 | ||
| 13 | +(commit eb75633d0dfa86341e6ef77a861665c4a0f16ab8), which is a 1.x->2.x | ||
| 14 | +breaking upgrade. | ||
| 15 | + | ||
| 16 | +Applies to h2 1.4.196 with: patch -p1 < fix-CVE-2022-23221.patch | ||
| 17 | +--- | ||
| 18 | + src/main/org/h2/tools/Console.java | 2 +- | ||
| 19 | + 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 20 | + | ||
| 21 | +diff --git a/src/main/org/h2/tools/Console.java b/src/main/org/h2/tools/Console.java | ||
| 22 | +--- a/src/main/org/h2/tools/Console.java | ||
| 23 | ++++ b/src/main/org/h2/tools/Console.java | ||
| 24 | +@@ -99,7 +99,7 @@ ShutdownHandler { | ||
| 25 | + * @param args the command line arguments | ||
| 26 | + */ | ||
| 27 | + public static void main(String... args) throws SQLException { | ||
| 28 | +- new Console().runTool(args); | ||
| 29 | ++ System.out.println("H2 Console has been disabled to mitigate CVE-2022-23221."); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + /** | ||