Incorrect Default Permissions in log4js
Impact
Default file permissions for log files created by the file, fileSync and dateFile appenders are world-readable (in unix). This could cause problems if log files contain sensitive information. This would affect any users that have not supplied their own permissions for the files via the mode parameter in the config.
Patches
Fixed by:
- https://github.com/log4js-node/log4js-node/pull/1141
- https://github.com/log4js-node/streamroller/pull/87
Released to NPM in log4js@6.4.0
Workarounds
Every version of log4js published allows passing the mode parameter to the configuration of file appenders, see the documentation for details.
References
Thanks to ranjit-git for raising the issue, and to @lamweili for fixing the problem.
For more information
If you have any questions or comments about this advisory:
- Open an issue in logj4s-node
- Ask a question in the slack channel
- Email us at gareth.nomiddlename@gmail.com
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | log4js | < 6.4.0 | 6.4.0 |
References
- https://github.com/log4js-node/log4js-node/security/advisories/GHSA-82v2-mx6x-wq7q
- https://nvd.nist.gov/vuln/detail/CVE-2022-21704
- https://github.com/log4js-node/log4js-node/pull/1141/commits/8042252861a1b65adb66931fdf702ead34fa9b76
- https://github.com/log4js-node/streamroller/pull/87
- https://github.com/log4js-node/log4js-node
- https://github.com/log4js-node/log4js-node/blob/v6.4.0/CHANGELOG.md#640
- https://lists.debian.org/debian-lts-announce/2022/12/msg00014.html
- CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N- Weakness (CWE)
CWE-276- Platform
- npm
- Package
log4js- Disclosed
- 21.01.2022
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-82v2-mx6x-wq7q - CC BY 4.0
Vulnerability history: log4js
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.