Amazon Linux 2023 : nodejs20, nodejs20-devel, nodejs20-full-i18n (ALAS2023-2024-544)

high Nessus Plugin ID 191606

Synopsis

The remote Amazon Linux 2023 host is missing a security update.

Description

It is, therefore, affected by multiple vulnerabilities as referenced in the ALAS2023-2024-544 advisory.

- The Node.js Permission Model does not clarify in the documentation that wildcards should be only used as the last character of a file path. For example: ``` --allow-fs-read=/home/node/.ssh/*.pub ``` will ignore `pub` and give access to everything after `.ssh/`. This misleading documentation affects all users using the experimental permission model in Node.js 20 and Node.js 21. Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js. (CVE-2024-21890)

- Node.js depends on multiple built-in utility functions to normalize paths provided to node:fs functions, which can be overwitten with user-defined implementations leading to filesystem permission model bypass through path traversal attack. This vulnerability affects all users using the experimental permission model in Node.js 20 and Node.js 21. Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js. (CVE-2024-21891)

- On Linux, Node.js ignores certain environment variables if those may have been set by an unprivileged user while the process is running with elevated privileges with the only exception of CAP_NET_BIND_SERVICE. Due to a bug in the implementation of this exception, Node.js incorrectly applies this exception even when certain other capabilities have been set. This allows unprivileged users to inject code that inherits the process's elevated privileges. (CVE-2024-21892)

- The permission model protects itself against path traversal attacks by calling path.resolve() on any paths given by the user. If the path is to be treated as a Buffer, the implementation uses Buffer.from() to obtain a Buffer from the result of path.resolve(). By monkey-patching Buffer internals, namely, Buffer.prototype.utf8Write, the application can modify the result of path.resolve(), which leads to a path traversal vulnerability. This vulnerability affects all users using the experimental permission model in Node.js 20 and Node.js 21. Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js. (CVE-2024-21896)

- A vulnerability in Node.js HTTP servers allows an attacker to send a specially crafted HTTP request with chunked encoding, leading to resource exhaustion and denial of service (DoS). The server reads an unbounded number of bytes from a single connection, exploiting the lack of limitations on chunk extension bytes. The issue can cause CPU and network bandwidth exhaustion, bypassing standard safeguards like timeouts and body size limits. (CVE-2024-22019)

- Undici is an HTTP/1.1 client, written from scratch for Node.js. Undici already cleared Authorization headers on cross-origin redirects, but did not clear `Proxy-Authentication` headers. This issue has been patched in versions 5.28.3 and 6.6.1. Users are advised to upgrade. There are no known workarounds for this vulnerability. (CVE-2024-24758)

- setuid() does not affect libuv's internal io_uring operations if initialized before the call to setuid().
This allows the process to perform privileged operations despite presumably having dropped such privileges through a call to setuid(). Impacts: Thank you, to valette for reporting this vulnerability and thank you Tobias Nieen for fixing it. (CVE-2024-22017)

- 2024-03-13: CVE-2024-22025 was added to this advisory. (CVE-2024-22025)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Run 'dnf update nodejs20 --releasever 2023.3.20240304' to update your system.

See Also

https://alas.aws.amazon.com/AL2023/ALAS-2024-544.html

https://alas.aws.amazon.com/faqs.html

https://alas.aws.amazon.com/cve/html/CVE-2024-21890.html

https://alas.aws.amazon.com/cve/html/CVE-2024-21891.html

https://alas.aws.amazon.com/cve/html/CVE-2024-21892.html

https://alas.aws.amazon.com/cve/html/CVE-2024-21896.html

https://alas.aws.amazon.com/cve/html/CVE-2024-22017.html

https://alas.aws.amazon.com/cve/html/CVE-2024-22019.html

https://alas.aws.amazon.com/cve/html/CVE-2024-22025.html

https://alas.aws.amazon.com/cve/html/CVE-2024-24758.html

Plugin Details

Severity: High

ID: 191606

File Name: al2023_ALAS2023-2024-544.nasl

Version: 1.1

Type: local

Agent: unix

Published: 3/6/2024

Updated: 3/18/2024

Supported Sensors: Agentless Assessment, Frictionless Assessment Agent, Frictionless Assessment AWS, Nessus Agent, Nessus

Risk Information

VPR

Risk Factor: High

Score: 7.9

CVSS v2

Risk Factor: High

Base Score: 7.2

Temporal Score: 5.3

Vector: CVSS2#AV:L/AC:L/Au:N/C:C/I:C/A:C

CVSS Score Source: CVE-2024-22017

CVSS v3

Risk Factor: High

Base Score: 7.9

Temporal Score: 6.9

Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

Temporal Vector: CVSS:3.0/E:U/RL:O/RC:C

CVSS Score Source: CVE-2024-21896

Vulnerability Information

CPE: p-cpe:/a:amazon:linux:nodejs20, p-cpe:/a:amazon:linux:nodejs20-debuginfo, p-cpe:/a:amazon:linux:nodejs20-debugsource, p-cpe:/a:amazon:linux:nodejs20-devel, p-cpe:/a:amazon:linux:nodejs20-docs, p-cpe:/a:amazon:linux:nodejs20-full-i18n, p-cpe:/a:amazon:linux:nodejs20-libs, p-cpe:/a:amazon:linux:nodejs20-libs-debuginfo, p-cpe:/a:amazon:linux:nodejs20-npm, p-cpe:/a:amazon:linux:v8-11.3-devel, cpe:/o:amazon:linux:2023

Required KB Items: Host/local_checks_enabled, Host/AmazonLinux/release, Host/AmazonLinux/rpm-list

Exploit Ease: No known exploits are available

Patch Publication Date: 2/29/2024

Vulnerability Publication Date: 2/14/2024

Reference Information

CVE: CVE-2024-21890, CVE-2024-21891, CVE-2024-21892, CVE-2024-21896, CVE-2024-22017, CVE-2024-22019, CVE-2024-22025, CVE-2024-24758