CyberSecBulletin
CVE-2022-41853NVD status: Modified

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.

Patch this week

Critical severity: a successful attack would have severe impact.

What to do

  1. Update hsqldb to 2.7.1 or a later version.
  2. Update Hypersql Database to 2.7.1 or a later version.
  3. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
HyperSQL DataBasehsqldbbefore 2.7.12.7.1
HsqldbHypersql Databasebefore 2.7.12.7.1
DebianDebian Linux10.0; 11.0Not 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 systemScoreSeverityScored by
CVSS 3.18.0HighCNA (google.com)
CVSS 3.19.8CriticalNVD

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

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Recent Use of Externally-Controlled Input to Select Classes or Code vulnerabilities

Spotted an error? Tell us.