Skip to main content

CVE-2025-23165: Vulnerability in nodejs node

Low
VulnerabilityCVE-2025-23165cvecve-2025-23165
Published: Mon May 19 2025 (05/19/2025, 01:25:08 UTC)
Source: CVE
Vendor/Project: nodejs
Product: node

Description

In Node.js, the `ReadFileUtf8` internal binding leaks memory due to a corrupted pointer in `uv_fs_s.file`: a UTF-16 path buffer is allocated but subsequently overwritten when the file descriptor is set. This results in an unrecoverable memory leak on every call. Repeated use can cause unbounded memory growth, leading to a denial of service. Impact: * This vulnerability affects APIs relying on `ReadFileUtf8` on Node.js release lines: v20 and v22.

AI-Powered Analysis

AILast updated: 07/11/2025, 10:33:44 UTC

Technical Analysis

CVE-2025-23165 is a memory leak vulnerability identified in Node.js, specifically within the internal binding function `ReadFileUtf8`. The issue arises due to a corrupted pointer in the `uv_fs_s.file` structure. In this vulnerability, a UTF-16 path buffer is allocated but subsequently overwritten when the file descriptor is set, causing the allocated memory to be leaked and unrecoverable. This memory leak occurs on every invocation of the affected function, leading to unbounded memory growth if the function is called repeatedly. The vulnerability affects Node.js release lines v20 and v22, but the affected versions list includes a broad range from v4.0 through v22.0, indicating that the underlying issue may exist in multiple versions or that the vulnerability was backported or present in earlier versions. The vulnerability is categorized under CWE-401 (Improper Release of Memory Before Removing Last Reference), which is a classic memory leak issue. The CVSS 3.0 base score is 3.7, indicating a low severity level. The vector string (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L) shows that the attack vector is network-based, requires high attack complexity, no privileges, no user interaction, and impacts availability only at a low level. The primary impact is denial of service (DoS) due to memory exhaustion caused by the leak. No known exploits are reported in the wild, and no patches are linked yet. This vulnerability primarily affects APIs relying on `ReadFileUtf8` for file reading operations in Node.js, which is a widely used JavaScript runtime environment for server-side applications. The memory leak can degrade system performance and eventually cause application or system crashes if memory is exhausted, impacting availability of services running Node.js.

Potential Impact

For European organizations, the impact of CVE-2025-23165 depends on their reliance on Node.js for backend services, especially those that use APIs invoking `ReadFileUtf8`. Organizations running web servers, microservices, or serverless functions on Node.js versions 20 or 22 are at risk. The memory leak can cause gradual degradation of service performance, leading to denial of service conditions that disrupt business operations. This is particularly critical for high-availability services such as e-commerce platforms, financial services, healthcare systems, and public sector applications. Since the vulnerability does not affect confidentiality or integrity, the primary concern is availability. However, denial of service in critical infrastructure or customer-facing applications can result in financial losses, reputational damage, and regulatory scrutiny under frameworks like GDPR if service disruptions affect personal data processing. The requirement for high attack complexity and no known exploits in the wild reduces immediate risk, but targeted attackers or accidental triggering through high-volume legitimate requests could still cause outages. European organizations with automated or high-frequency file reading operations in Node.js environments are more vulnerable to this issue.

Mitigation Recommendations

To mitigate CVE-2025-23165, European organizations should: 1) Monitor and limit the usage of APIs that rely on `ReadFileUtf8` to reduce the frequency of calls that could trigger the memory leak. 2) Implement resource usage monitoring and alerting for Node.js processes, focusing on memory consumption trends to detect abnormal growth early. 3) Employ container or process-level memory limits and automatic restarts to contain the impact of memory leaks and maintain service availability. 4) Upgrade Node.js to patched versions once available; in the meantime, consider backporting fixes or applying vendor-provided workarounds if any. 5) Review application code to avoid unnecessary or repeated file reads using vulnerable APIs, and refactor to use alternative safe file reading methods if possible. 6) Conduct thorough testing in staging environments to evaluate the impact of the vulnerability and mitigation strategies under realistic workloads. 7) Engage with Node.js security advisories and community channels to stay informed about patches and exploit developments. These steps go beyond generic advice by focusing on operational controls, proactive monitoring, and code-level adjustments specific to the vulnerability's nature.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
hackerone
Date Reserved
2025-01-12T01:00:00.648Z
Cisa Enriched
true
Cvss Version
3.0
State
PUBLISHED

Threat ID: 682cd0f81484d88663aeb818

Added to database: 5/20/2025, 6:59:04 PM

Last enriched: 7/11/2025, 10:33:44 AM

Last updated: 8/13/2025, 10:29:55 AM

Views: 16

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats