Postgresql Jdbc Driver: Improper Initialization
CVE-2022-21724 is a critical-severity improper initialization vulnerability in Postgresql Jdbc Driver from PostgreSQL, 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 versions 42.2.25, 42.3.2 as the first without the flaw, so updating Postgresql Jdbc Driver to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 3.09% chance of exploitation within 30 days, higher than 88% of scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Update Postgresql Jdbc Driver to 42.2.25 or 42.3.2, whichever matches your release line, or a later version.
- Update Quarkus to 2.7.2 or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
- 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 |
|---|---|---|---|
| PostgreSQL | Postgresql Jdbc Driver | before 42.2.25; 42.3.0 up to, but not including, 42.3.2; 42.3.2 | 42.2.25, 42.3.2 |
| Fedora Project | Fedora | 35 | Not stated |
| Quarkus | Quarkus | before 2.7.2 | 2.7.2 |
| Debian | Debian Linux | 9.0; 10.0; 11.0 | Not stated |
Version data comes from NVD's product matching. 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 | 7.0 | High | CNA (github.com) |
| CVSS 3.1 | 9.8 | Critical | NVD |
| CVSS 2.0 | 7.5 | High | NVD |
Official description
pgjdbc is the offical PostgreSQL JDBC Driver. A security hole was found in the jdbc driver for postgresql database while doing security research. The system using the postgresql library will be attacked when attacker control the jdbc url or properties. pgjdbc instantiates plugin instances based on class names provided via `authenticationPluginClassName`, `sslhostnameverifier`, `socketFactory`, `sslfactory`, `sslpasswordcallback` connection properties. However, the driver did not verify if the class implements the expected interface before instantiating the class. This can lead to code execution loaded via arbitrary classes. Users using plugins are advised to upgrade. There are no known workarounds for this issue.
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.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/pgjdbc/pgjdbc/security/advisories/GHSA-v7wg-cpwc-24m4Exploit, Third Party Advisory
Patches and release notes
- github.com/pgjdbc/pgjdbc/commit/f4d0ed69c0b3aae8531d83d6af4c57f22312c813Third Party Advisory
Third-party and government advisories
- lists.debian.org/debian-lts-announce/2022/05/msg00027.htmlMailing List, Third Party Advisory
- security.netapp.com/advisory/ntap-20220311-0005/Third Party Advisory
- debian.org/security/2022/dsa-5196Third Party Advisory
Other references
Other vulnerabilities in Postgresql Jdbc Driver
- 7.5 High severity
- 9.8 Critical severity
- 8.0 High severity
Recent Improper Initialization vulnerabilities
- 5.5 Medium severity
- 6.5 Medium severity
Mozilla Firefox Information Disclosure Exploited
Spotted an error? Tell us.