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-21704

CVE-2022-21704: Log4js Information Disclosure Vulnerability

CVE-2022-21704 is an information disclosure vulnerability in Log4js-node where default file permissions make log files world-readable, potentially exposing sensitive data. This article covers technical details, impacts, and mitigations.

Published: February 17, 2026

CVE-2022-21704 Overview

CVE-2022-21704 is an insecure permissions vulnerability in log4js-node, a popular port of log4js to Node.js. In affected versions, the default file permissions for log files created by the file, fileSync, and dateFile appenders are world-readable (in Unix-based systems). This misconfiguration could lead to sensitive information disclosure if log files contain confidential data such as user credentials, session tokens, API keys, or personally identifiable information.

Critical Impact

Log files created with default settings are world-readable, potentially exposing sensitive application data to any local user on the system.

Affected Products

  • log4js-node (versions prior to 6.4.0)
  • Debian Linux 10.0

Discovery Timeline

  • 2022-01-19 - CVE-2022-21704 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-21704

Vulnerability Analysis

This vulnerability stems from improper default file permissions (CWE-276) in the log4js-node library. When applications use the file, fileSync, or dateFile appenders without explicitly specifying the mode parameter in their configuration, log files are created with world-readable permissions. This allows any user on the system to read the contents of these log files.

The vulnerability requires local access to exploit, as an attacker must be able to read files on the same system where the vulnerable application is running. While this limits the attack surface, multi-tenant environments, shared hosting platforms, and systems with multiple user accounts are particularly at risk.

Root Cause

The root cause of CVE-2022-21704 is the absence of secure default file permissions in the log4js-node library. When creating log files, the library did not apply restrictive permissions by default, leaving files accessible to all users on the system. The fix, implemented in the streamroller dependency, changes the default file creation mode to be more restrictive, ensuring log files are only readable by the file owner.

Attack Vector

The attack vector for this vulnerability is local access exploitation. An attacker with a valid user account on the affected system can navigate to the directory where log files are stored and read their contents without requiring elevated privileges. The exploitation path involves:

  1. Identifying applications using vulnerable versions of log4js-node
  2. Locating the log file storage directory
  3. Reading log files containing potentially sensitive information
  4. Extracting credentials, tokens, or other confidential data from the logs

Due to the nature of this vulnerability, exploitation does not require any sophisticated techniques—simple file read operations are sufficient once the attacker has local access.

Detection Methods for CVE-2022-21704

Indicators of Compromise

  • Log files with permissions set to 644 or more permissive (world-readable)
  • Unexpected user access to application log directories
  • Evidence of log file enumeration by non-administrative users
  • Audit logs showing read access to sensitive log files by unauthorized accounts

Detection Strategies

  • Run ls -la on log directories to identify files with world-readable permissions
  • Use file integrity monitoring to detect permission changes on log files
  • Implement audit rules with auditd to monitor access to log file directories
  • Scan for log4js-node dependencies with versions prior to 6.4.0 using npm audit or software composition analysis tools

Monitoring Recommendations

  • Enable file access auditing on directories containing application logs
  • Configure SIEM alerts for unusual log file access patterns
  • Monitor for bulk file enumeration activities in log directories
  • Implement regular permission audits using automated scripts or security scanners

How to Mitigate CVE-2022-21704

Immediate Actions Required

  • Upgrade log4js-node to version 6.4.0 or later
  • Review existing log files and update permissions to restrict access (chmod 600)
  • Audit log file contents for any sensitive information that may have been exposed
  • Implement explicit mode parameter in log4js configuration to enforce restrictive permissions

Patch Information

The vulnerability has been addressed in log4js-node version 6.4.0. The fix was implemented through updates to both the main log4js-node repository and the streamroller dependency. Organizations should update their dependencies to the patched versions:

  • Update log4js-node to version 6.4.0 or later via npm
  • Review the GitHub Changelog Entry for details on the fix
  • Consult the GitHub Security Advisory GHSA-82v2-mx6x-wq7q for additional remediation guidance
  • Debian users should apply updates per the Debian LTS Security Announcement

Workarounds

  • Explicitly set the mode parameter in your log4js appender configuration to restrict file permissions (e.g., mode: 0o600)
  • Move log files to directories accessible only by the application user
  • Use operating system-level access controls to restrict the log directory
  • Consider using centralized logging solutions that do not store sensitive data locally
bash
# Configuration example
# Update package.json and install patched version
npm install log4js@6.4.0

# Manually fix permissions on existing log files
find /var/log/myapp -name "*.log" -exec chmod 600 {} \;

# Verify permissions are restrictive
ls -la /var/log/myapp/*.log

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

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechLog4js

  • SeverityMEDIUM

  • CVSS Score5.5

  • EPSS Probability0.14%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-276
  • Technical References
  • GitHub Changelog Entry

  • Debian LTS Security Announcement
  • Vendor Resources
  • GitHub Pull Request Commit

  • GitHub Security Advisory GHSA-82v2-mx6x-wq7q

  • GitHub Streamroller Pull Request
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal 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