The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2022-21724

CVE-2022-21724: PostgreSQL JDBC Driver RCE Vulnerability

CVE-2022-21724 is a remote code execution vulnerability in PostgreSQL JDBC Driver allowing attackers to execute arbitrary code via malicious class instantiation. This article covers technical details, affected versions, and mitigation.

Published: February 18, 2026

CVE-2022-21724 Overview

CVE-2022-21724 is an Insecure Deserialization vulnerability in pgjdbc, the official PostgreSQL JDBC Driver. The driver instantiates plugin instances based on class names provided via several connection properties including authenticationPluginClassName, sslhostnameverifier, socketFactory, sslfactory, and sslpasswordcallback. However, the driver failed to verify whether the specified class implements the expected interface before instantiation. This vulnerability allows attackers who control the JDBC URL or connection properties to achieve arbitrary code execution by loading and instantiating malicious classes.

Critical Impact

Attackers with control over JDBC connection URLs or properties can achieve remote code execution by instantiating arbitrary classes, potentially leading to complete system compromise.

Affected Products

  • PostgreSQL JDBC Driver (pgjdbc) versions prior to 42.2.25 and 42.3.2
  • Fedora 35
  • Quarkus (affected versions)
  • Debian Linux 9.0, 10.0, 11.0

Discovery Timeline

  • 2022-02-02 - CVE-2022-21724 published to NVD
  • 2025-05-05 - Last updated in NVD database

Technical Details for CVE-2022-21724

Vulnerability Analysis

The vulnerability resides in the improper initialization of plugin classes within the PostgreSQL JDBC driver. When establishing a database connection, pgjdbc allows users to specify custom implementations for various security-related components through connection properties. The affected properties include authenticationPluginClassName, sslhostnameverifier, socketFactory, sslfactory, and sslpasswordcallback.

The core issue stems from the ObjectFactory.instantiate() method which accepted any class name and instantiated it without validating that the class implements the required interface. An attacker who can control these connection properties—either through direct JDBC URL manipulation or by influencing application configuration—can specify arbitrary class names. When the driver instantiates these classes, it triggers their constructors, enabling code execution with the privileges of the application.

This represents a classic Unsafe Reflection vulnerability pattern (CWE-665: Improper Initialization), where inadequate type checking during dynamic class loading creates an exploitation path.

Root Cause

The root cause is the missing type validation in the ObjectFactory.instantiate() method. The original implementation used a simple cast to the expected interface type after instantiation, rather than validating the class type beforehand. This means any class on the classpath could be instantiated through the vulnerable connection properties, regardless of whether it implemented the expected interface such as SocketFactory or AuthenticationPlugin.

Attack Vector

This network-based attack requires the attacker to control the JDBC connection URL or connection properties. Attack scenarios include:

  1. Malicious Configuration Injection: If an application reads JDBC connection strings from user-controlled input, configuration files, or environment variables that attackers can manipulate
  2. Supply Chain Attacks: Compromised configuration management systems or deployment pipelines that inject malicious connection parameters
  3. Internal Network Attacks: Attackers with access to internal systems modifying database connection configurations

The fix implemented in the security patch adds explicit type checking by passing the expected class type to the ObjectFactory.instantiate() method:

java
// Before (vulnerable)
return (SocketFactory) ObjectFactory.instantiate(socketFactoryClassName, info, true,
    PGProperty.SOCKET_FACTORY_ARG.get(info));

// After (patched)
return ObjectFactory.instantiate(SocketFactory.class, socketFactoryClassName, info, true,
    PGProperty.SOCKET_FACTORY_ARG.get(info));

Source: GitHub Commit

Similarly, the AuthenticationPluginManager.java was patched to include proper type validation:

java
// Before (vulnerable)
authPlugin = (AuthenticationPlugin) ObjectFactory.instantiate(authPluginClassName, info,
    false, null);

// After (patched)
authPlugin = ObjectFactory.instantiate(AuthenticationPlugin.class, authPluginClassName, info,
    false, null);

Source: GitHub Commit

Detection Methods for CVE-2022-21724

Indicators of Compromise

  • Unusual JDBC connection strings containing suspicious class names in authenticationPluginClassName, sslhostnameverifier, socketFactory, sslfactory, or sslpasswordcallback properties
  • Unexpected class loading activity from the PostgreSQL JDBC driver process
  • Application logs showing instantiation errors with unexpected class names or PSQLState.INVALID_PARAMETER_VALUE errors
  • Process execution or network connections originating from Java applications using pgjdbc that don't match normal behavior

Detection Strategies

  • Implement application-layer monitoring for JDBC connection string modifications and validate against an allowlist of expected connection parameters
  • Deploy runtime application self-protection (RASP) solutions to detect and block arbitrary class instantiation attempts
  • Configure SentinelOne agents to monitor Java applications for suspicious class loading behavior and unexpected process spawning
  • Audit configuration management systems and deployment pipelines for unauthorized changes to database connection settings

Monitoring Recommendations

  • Enable verbose logging for JDBC driver initialization to capture connection property values and class instantiation attempts
  • Implement centralized logging and alerting for database connection configuration changes across all environments
  • Monitor application classpath for unexpected or malicious JAR files that could be loaded through this vulnerability

How to Mitigate CVE-2022-21724

Immediate Actions Required

  • Upgrade PostgreSQL JDBC Driver to version 42.2.25 or later (for 42.2.x branch) or 42.3.2 or later (for 42.3.x branch)
  • Audit all applications using pgjdbc to identify instances where JDBC connection strings may be influenced by untrusted input
  • Implement strict input validation for any user-controlled database connection parameters
  • Review and restrict access to configuration files and environment variables containing database connection strings

Patch Information

The vulnerability has been addressed in commit f4d0ed69c0b3aae8531d83d6af4c57f22312c813 which adds proper type validation before class instantiation. The fix ensures that classes specified in plugin connection properties actually implement the expected interfaces. Additional security advisories have been released by Debian, Fedora, and NetApp.

Workarounds

  • There are no known workarounds for this vulnerability according to the official advisory; upgrading is strongly recommended
  • As a defense-in-depth measure, ensure JDBC connection strings are never constructed from untrusted user input
  • Implement network segmentation to limit exposure of applications using vulnerable pgjdbc versions
  • Consider using connection pooling solutions that validate connection parameters before passing them to the driver
bash
# Verify installed pgjdbc version in Maven projects
mvn dependency:tree | grep postgresql

# Update pgjdbc in Maven pom.xml to patched version
# For 42.2.x branch, use 42.2.25 or later
# For 42.3.x branch, use 42.3.2 or later
mvn versions:use-latest-versions -Dincludes=org.postgresql:postgresql

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPostgresql

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability4.81%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-665
  • Technical References
  • GitHub Security Advisory

  • Debian LTS Announcement

  • Fedora Package Announcement

  • NetApp Security Advisory

  • Debian Security Advisory
  • Vendor Resources
  • GitHub Commit Update
  • Related CVEs
  • CVE-2025-13957: Hard-coded Credentials RCE Vulnerability

  • CVE-2026-2004: PostgreSQL intarray Extension RCE Flaw

  • CVE-2026-2006: PostgreSQL RCE Vulnerability

  • CVE-2023-5869: PostgreSQL RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English