CVE-2022-21704
JavaScript vulnerability analysis and mitigation

Overview

CVE-2022-21704 affects log4js-node, a port of log4js to node.js. The vulnerability was discovered in versions prior to 6.4.0, where default file permissions for log files created by the file, fileSync, and dateFile appenders were set to world-readable (0o644) in Unix systems. This security issue was disclosed on January 19, 2022, and could potentially expose sensitive information in log files (GitHub Advisory).

Technical details

The vulnerability stems from incorrect default permissions (0o644) set for log files, which made them world-readable. This affects the file, fileSync, and dateFile appenders in the log4js-node package. The issue has been assigned a CVSS v3.1 base score of 5.5 (Medium) with the vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N. The vulnerability is classified as CWE-276 (Incorrect Default Permissions) (NVD).

Impact

The primary impact of this vulnerability is the potential exposure of sensitive information. Since log files were created with world-readable permissions by default, any user on the system could read the log files if they contained sensitive data. This particularly affects users who had not explicitly set their own file permissions through the mode parameter in the configuration (GitHub Advisory).

Mitigation and workarounds

The issue has been fixed in version 6.4.0 of log4js-node by changing the default file permissions from 0o644 to 0o600. Users are advised to upgrade to this version or later. For those unable to upgrade immediately, a workaround is available by explicitly setting the mode parameter in the appender configuration to restrict file permissions (GitHub Commit).

Community reactions

The vulnerability was addressed in various distributions, including Debian, which released security updates to address this issue. Debian provided the fix in version 4.0.2-2+deb10u1 for Debian 10 (buster) (Debian Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-55182CRITICAL10
  • JavaScriptJavaScript
  • react
NoYesDec 03, 2025
CVE-2025-66401CRITICAL9.8
  • JavaScriptJavaScript
  • mcp-watch
NoNoDec 01, 2025
CVE-2025-66412HIGH8.5
  • JavaScriptJavaScript
  • @angular/compiler
NoYesDec 01, 2025
CVE-2025-66415MEDIUM6.9
  • JavaScriptJavaScript
  • @fastify/reply-from
NoYesDec 01, 2025
CVE-2025-66405MEDIUM6.9
  • JavaScriptJavaScript
  • @portkey-ai/gateway
NoYesDec 01, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management