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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-23305

CVE-2022-23305: Apache Log4j SQLI Vulnerability

CVE-2022-23305 is a SQL injection flaw in Apache Log4j 1.2.x JDBCAppender that lets attackers execute unintended SQL queries through crafted input. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2022-23305 Overview

CVE-2022-23305 is a SQL Injection vulnerability in the JDBCAppender component of Apache Log4j 1.2.x. By design, the JDBCAppender accepts an SQL statement as a configuration parameter where the values to be inserted are converters from PatternLayout. The message converter, %m, is likely to always be included in these configurations. This design flaw allows attackers to manipulate SQL queries by entering crafted strings into input fields or headers of an application that are logged, enabling unintended SQL queries to be executed against the backend database.

Critical Impact

Attackers can execute arbitrary SQL queries through log message injection, potentially leading to data exfiltration, data manipulation, or complete database compromise. This vulnerability affects applications using the legacy Log4j 1.x with JDBCAppender configured.

Affected Products

  • Apache Log4j 1.2.x (all versions)
  • NetApp SnapManager (for Oracle and SAP)
  • Broadcom Brocade SANnav
  • QOS reload4j
  • Oracle WebLogic Server (versions 12.2.1.3.0, 12.2.1.4.0, 14.1.1.0.0)
  • Oracle Business Intelligence (versions 5.9.0.0.0, 12.2.1.3.0, 12.2.1.4.0)
  • Oracle Enterprise Manager Base Platform (versions 13.4.0.0, 13.5.0.0)
  • Oracle MySQL Enterprise Monitor
  • Oracle Communications products (multiple versions)

Discovery Timeline

  • 2022-01-18 - CVE-2022-23305 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-23305

Vulnerability Analysis

This SQL Injection vulnerability exists in the architectural design of Log4j 1.x's JDBCAppender component. When applications configure JDBCAppender to log messages directly to a database, the SQL statement template uses PatternLayout converters to insert values. The %m converter, which represents the log message content, is typically included in these SQL templates.

The fundamental issue is that user-controllable data (log messages) is concatenated directly into SQL statements without proper parameterization or sanitization. When an application logs user input—such as HTTP headers, form fields, or other request parameters—attackers can inject malicious SQL syntax that gets executed against the database.

This vulnerability affects applications that meet all of the following conditions: they use Log4j 1.2.x, have explicitly configured JDBCAppender (not the default configuration), and log user-controllable input. The vulnerability does not require authentication and can be exploited remotely over the network.

Root Cause

The root cause is the use of string concatenation for SQL query construction within JDBCAppender rather than prepared statements with parameterized queries. The PatternLayout system was designed for flexible log formatting but was not designed with SQL injection prevention in mind. When the %m pattern (or similar user-influenced patterns) is included in SQL templates, the logged message content is directly embedded into the SQL statement without escaping or parameterization.

Apache Log4j 1.2 reached end of life in August 2015, and this architectural limitation was addressed in Log4j 2.0-beta8 and later, where JDBCAppender was re-introduced with proper support for parameterized SQL queries.

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by injecting SQL syntax into any input field, HTTP header, or other data that eventually gets logged through the JDBCAppender. The injected content becomes part of the SQL statement executed against the database.

For example, if an application logs HTTP headers and an attacker controls a header value, they can craft input containing SQL injection payloads. When this data is logged via JDBCAppender, the malicious SQL is executed. Common attack scenarios include injecting into User-Agent headers, authentication fields, or any other logged parameters.

The attack does not require direct access to the application's database—only the ability to submit input that will be logged. This makes it particularly dangerous in web applications where multiple input vectors may be logged for debugging or auditing purposes.

Detection Methods for CVE-2022-23305

Indicators of Compromise

  • Database query logs showing unusual or malformed SQL statements containing injection patterns such as '; DROP TABLE, UNION SELECT, or OR '1'='1
  • Application logs containing suspicious input patterns in logged fields that resemble SQL syntax
  • Unexpected database modifications, data exfiltration, or access to sensitive tables
  • Error messages in logs indicating SQL syntax errors from malformed injected queries

Detection Strategies

  • Scan application dependencies and configuration files to identify usage of Log4j 1.x with JDBCAppender enabled
  • Implement database activity monitoring to detect anomalous SQL query patterns
  • Deploy web application firewalls (WAF) with SQL injection detection rules to identify malicious payloads in HTTP requests
  • Use software composition analysis (SCA) tools to identify vulnerable Log4j 1.x libraries in the codebase

Monitoring Recommendations

  • Enable detailed database query logging to capture and analyze all executed SQL statements
  • Monitor application logs for input containing SQL keywords and special characters in logged fields
  • Configure alerts for database errors that may indicate failed injection attempts
  • Implement centralized logging with correlation capabilities to trace injection attempts across application and database layers

How to Mitigate CVE-2022-23305

Immediate Actions Required

  • Upgrade to Apache Log4j 2.x (version 2.17.1 or later recommended) which includes proper parameterized SQL query support
  • If immediate upgrade is not possible, disable or remove JDBCAppender configuration from Log4j 1.x deployments
  • Migrate to QOS reload4j (patched fork of Log4j 1.x) as an interim solution if Log4j 2.x migration requires significant effort
  • Audit all applications to identify those using Log4j 1.x with JDBCAppender configurations

Patch Information

Apache Log4j 1.2 reached end of life in August 2015, and no official patches will be released for this version. The recommended remediation is to migrate to Log4j 2.x, where JDBCAppender was re-implemented with parameterized SQL queries starting in version 2.0-beta8.

For organizations unable to immediately migrate, QOS reload4j provides a drop-in replacement fork of Log4j 1.x with security fixes. Oracle has released patches for affected products in their April 2022 Critical Patch Update and July 2022 Critical Patch Update. NetApp has also published Security Advisory NTAP-20220217-0007 addressing this vulnerability.

Workarounds

  • Remove or comment out JDBCAppender configurations from log4j.properties or log4j.xml configuration files
  • Implement input validation and sanitization at the application layer before data reaches the logging framework
  • Configure database user permissions to limit the potential impact of SQL injection (principle of least privilege)
  • Use alternative appenders (FileAppender, ConsoleAppender) that do not execute SQL queries
bash
# Configuration example - Disabling JDBCAppender in log4j.properties
# Comment out or remove JDBCAppender configuration
# log4j.appender.DB=org.apache.log4j.jdbc.JDBCAppender
# log4j.appender.DB.URL=jdbc:mysql://localhost/logs
# log4j.appender.DB.driver=com.mysql.jdbc.Driver
# log4j.appender.DB.user=log_user
# log4j.appender.DB.password=log_password
# log4j.appender.DB.sql=INSERT INTO LOGS VALUES('%m')

# Use FileAppender as a safe alternative
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/var/log/application.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

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

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechApache Log4j

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability7.95%

  • 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-89
  • Technical References
  • Openwall OSS Security Mailing List

  • NetApp Security Advisory NTAP-20220217-0007
  • Vendor Resources
  • Apache Thread Discussion

  • Apache Log4j Documentation

  • Oracle CPU April 2022 Alert

  • Oracle CPU July 2022 Alert
  • Related CVEs
  • CVE-2026-34479: Apache Log4j XML Output Vulnerability

  • CVE-2026-34478: Apache Log4j Core Log Injection Vulnerability

  • CVE-2026-34480: Apache Log4j Core XXE Vulnerability

  • CVE-2026-34481: Apache Log4j JSON Output 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