hsqldb: Use of Externally-Controlled Input to Select Classes or Code
CVE-2022-41853 is a critical-severity use of externally-controlled input to select classes or code vulnerability in hsqldb from HyperSQL DataBase, with a CVSS 3.1 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 2.7.1 as the first without the flaw, so updating hsqldb to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 5.15% chance of exploitation within 30 days, which is in the top 7.45% of all scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Update hsqldb to 2.7.1 or a later version.
- Update Hypersql Database to 2.7.1 or a later version.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| HyperSQL DataBase | hsqldb | before 2.7.1 | 2.7.1 |
| Hsqldb | Hypersql Database | before 2.7.1 | 2.7.1 |
| Debian | Debian Linux | 10.0; 11.0 | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 8.0 | High | CNA (google.com) |
| CVSS 3.1 | 9.8 | Critical | NVD |
Official description
Those using java.sql.Statement or java.sql.PreparedStatement in hsqldb (HyperSQL DataBase) to process untrusted input may be vulnerable to a remote code execution attack. By default it is allowed to call any static method of any Java class in the classpath resulting in code execution. The issue can be prevented by updating to 2.7.1 or by setting the system property "hsqldb.method_class_names" to classes which are allowed to be called. For example, System.setProperty("hsqldb.method_class_names", "abc") or Java argument -Dhsqldb.method_class_names="abc" can be used. From version 2.7.1 all classes by default are not accessible except those in java.lang.Math and need to be manually enabled.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Use of Externally-Controlled Input to Select Classes or Code
The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.
How developers prevent this class of flaw
- Refactor your code to avoid using reflection.
- Do not use user-controlled inputs to select and load classes or code.
- Apply strict input validation by using allowlists or indirect selection to ensure that the user is only selecting allowable classes or code.
More Use of Externally-Controlled Input to Select Classes or Code vulnerabilities (CWE-470)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Third-party and government advisories
- hsqldb.org/doc/2.0/guide/sqlroutines-chapt.html#src_jrt_access_controlThird Party Advisory
- bugs.chromium.org/p/oss-fuzz/issues/detail?id=50212#c7Mailing List, Third Party Advisory
- lists.debian.org/debian-lts-announce/2022/12/msg00020.htmlMailing List, Third Party Advisory
- debian.org/security/2023/dsa-5313Third Party Advisory
Recent Use of Externally-Controlled Input to Select Classes or Code vulnerabilities
- 7.8 High severity
- 8.0 High severity
Spotted an error? Tell us.