ghsa-h376-j262-vhq6
Vulnerability from github
Impact
H2 Console in versions since 1.1.100 (2008-10-14) to 2.0.204 (2021-12-21) inclusive allows loading of custom classes from remote servers through JNDI.
H2 Console doesn't accept remote connections by default. If remote access was enabled explicitly and some protection method (such as security constraint) wasn't set, an intruder can load own custom class and execute its code in a process with H2 Console (H2 Server process or a web server with H2 Console servlet).
It is also possible to load them by creation a linked table in these versions, but it requires ADMIN
privileges and user with ADMIN
privileges has full access to the Java process by design. These privileges should never be granted to untrusted users.
Patches
Since version 2.0.206 H2 Console and linked tables explicitly forbid attempts to specify LDAP URLs for JNDI. Only local data sources can be used.
Workarounds
H2 Console should never be available to untrusted users.
-webAllowOthers
is a dangerous setting that should be avoided.
H2 Console Servlet deployed on a web server can be protected with a security constraint:
https://h2database.com/html/tutorial.html#usingH2ConsoleServlet
If webAllowOthers
is specified, you need to uncomment and edit <security-role>
and <security-constraint>
as necessary. See documentation of your web server for more details.
References
This issue was found and privately reported to H2 team by JFrog Security's vulnerability research team with detailed information.
{ "affected": [ { "package": { "ecosystem": "Maven", "name": "com.h2database:h2" }, "ranges": [ { "events": [ { "introduced": "1.1.100" }, { "fixed": "2.0.206" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2021-42392" ], "database_specific": { "cwe_ids": [ "CWE-502" ], "github_reviewed": true, "github_reviewed_at": "2022-01-06T20:14:33Z", "nvd_published_at": "2022-01-10T14:10:00Z", "severity": "CRITICAL" }, "details": "### Impact\nH2 Console in versions since 1.1.100 (2008-10-14) to 2.0.204 (2021-12-21) inclusive allows loading of custom classes from remote servers through JNDI.\n\nH2 Console doesn\u0027t accept remote connections by default. If remote access was enabled explicitly and some protection method (such as security constraint) wasn\u0027t set, an intruder can load own custom class and execute its code in a process with H2 Console (H2 Server process or a web server with H2 Console servlet).\n\nIt is also possible to load them by creation a linked table in these versions, but it requires `ADMIN` privileges and user with `ADMIN` privileges has full access to the Java process by design. These privileges should never be granted to untrusted users.\n\n### Patches\nSince version 2.0.206 H2 Console and linked tables explicitly forbid attempts to specify LDAP URLs for JNDI. Only local data sources can be used.\n\n### Workarounds\nH2 Console should never be available to untrusted users.\n\n`-webAllowOthers` is a dangerous setting that should be avoided.\n\nH2 Console Servlet deployed on a web server can be protected with a security constraint:\nhttps://h2database.com/html/tutorial.html#usingH2ConsoleServlet\nIf `webAllowOthers` is specified, you need to uncomment and edit `\u003csecurity-role\u003e` and `\u003csecurity-constraint\u003e` as necessary. See documentation of your web server for more details.\n\n### References\nThis issue was found and privately reported to H2 team by [JFrog Security](https://www.jfrog.com/)\u0027s vulnerability research team with detailed information.\n", "id": "GHSA-h376-j262-vhq6", "modified": "2022-01-20T15:36:58Z", "published": "2022-01-06T23:55:09Z", "references": [ { "type": "WEB", "url": "https://github.com/h2database/h2database/security/advisories/GHSA-h376-j262-vhq6" }, { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-42392" }, { "type": "PACKAGE", "url": "https://github.com/h2database/h2database" }, { "type": "WEB", "url": "https://github.com/h2database/h2database/releases/tag/version-2.0.206" }, { "type": "WEB", "url": "https://jfrog.com/blog/the-jndi-strikes-back-unauthenticated-rce-in-h2-database-console" }, { "type": "WEB", "url": "https://lists.debian.org/debian-lts-announce/2022/02/msg00017.html" }, { "type": "WEB", "url": "https://security.netapp.com/advisory/ntap-20220119-0001" }, { "type": "WEB", "url": "https://www.debian.org/security/2022/dsa-5076" }, { "type": "WEB", "url": "https://www.oracle.com/security-alerts/cpuapr2022.html" }, { "type": "WEB", "url": "https://www.secpod.com/blog/log4shell-critical-remote-code-execution-vulnerability-in-h2database-console" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "type": "CVSS_V3" } ], "summary": "RCE in H2 Console" }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.