CyberSecBulletin
CVE-2022-36364NVD status: Modified

Apache Calcite Avatica: Improper Initialization

CVE-2022-36364 is a high-severity improper initialization vulnerability in Apache Calcite Avatica from Apache, with a CVSS 3.1 base score of 8.8 out of 10. It can be exploited remotely over the network by an attacker with a low-privileged account, without any action from a user. The record lists version 1.22.0 as the first without the flaw, so updating Apache Calcite Avatica to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 3.16% chance of exploitation within 30 days, higher than 88% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Apache Calcite Avatica to 1.22.0 or a later version.
  2. Read the advisory on lists.apache.org for workarounds and exact fixed builds.

Affected products and versions

VendorProductAffected versionsFixed in
ApacheApache Calcite AvaticaApache Calcite Avatica up to, but not including, 1.22.01.22.0

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
LowA basic user account is enough.
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:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Official description

Apache Calcite Avatica JDBC driver creates HTTP client instances based on class names provided via `httpclient_impl` connection property; however, the driver does not verify if the class implements the expected interface before instantiating it, which can lead to code execution loaded via arbitrary classes and in rare cases remote code execution. To exploit the vulnerability: 1) the attacker needs to have privileges to control JDBC connection parameters; 2) and there should be a vulnerable class (constructor with URL parameter and ability to execute code) in the classpath. From Apache Calcite Avatica 1.22.0 onwards, it will be verified that the class implements the expected interface before invoking its constructor.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Improper Initialization

The product does not initialize or incorrectly initializes a resource.

How developers prevent this class of flaw

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, in Java, if the programmer does not explicitly initialize a variable, then the code could produce a compile-time error (if the variable is local) or automatically initialize the variable to the default value for the variable's type. In Perl, if explicit initialization is not performed, then a default value of undef is assigned, which is interpreted as 0, false, or an equivalent value depending on the context in which the variable is accessed.
  • Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values.
  • Explicitly initialize all your variables and other data stores, either during declaration or just before the first usage.

More Improper Initialization vulnerabilities (CWE-665)

Timeline

  1. CVE record published.
  2. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Other vulnerabilities in Apache Calcite Avatica

All Apache Calcite Avatica vulnerabilities

Recent Improper Initialization vulnerabilities

Spotted an error? Tell us.