Skip to content

Commit 7a4e880

Browse files
1 parent 1a65dff commit 7a4e880

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

Diff for: SPECS/nodejs/CVE-2025-22150.patch

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From d059d899b9c92a1479432016fe48a01d9254d89a Mon Sep 17 00:00:00 2001
2+
From: Kanishk Bansal <[email protected]>
3+
Date: Wed, 5 Feb 2025 12:28:55 +0000
4+
Subject: [PATCH] Address CVE-2025-22150
5+
6+
---
7+
deps/undici/src/lib/fetch/body.js | 10 +++++++++-
8+
1 file changed, 9 insertions(+), 1 deletion(-)
9+
10+
diff --git a/deps/undici/src/lib/fetch/body.js b/deps/undici/src/lib/fetch/body.js
11+
index fd8481b7..4afcfdfb 100644
12+
--- a/deps/undici/src/lib/fetch/body.js
13+
+++ b/deps/undici/src/lib/fetch/body.js
14+
@@ -22,6 +22,14 @@ const { isUint8Array, isArrayBuffer } = require('util/types')
15+
const { File: UndiciFile } = require('./file')
16+
const { parseMIMEType, serializeAMimeType } = require('./dataURL')
17+
18+
+let random
19+
+try {
20+
+ const crypto = require('node:crypto')
21+
+ random = (max) => crypto.randomInt(0, max)
22+
+} catch {
23+
+ random = (max) => Math.floor(Math.random(max))
24+
+}
25+
+
26+
let ReadableStream = globalThis.ReadableStream
27+
28+
/** @type {globalThis['File']} */
29+
@@ -107,7 +115,7 @@ function extractBody (object, keepalive = false) {
30+
// Set source to a copy of the bytes held by object.
31+
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
32+
} else if (util.isFormDataLike(object)) {
33+
- const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
34+
+ const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
35+
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
36+
37+
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
38+
--
39+
2.43.0
40+

Diff for: SPECS/nodejs/nodejs18.spec

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name: nodejs18
66
# WARNINGS: MUST check and update the 'npm_version' macro for every version update of this package.
77
# The version of NPM can be found inside the sources under 'deps/npm/package.json'.
88
Version: 18.20.3
9-
Release: 2%{?dist}
9+
Release: 3%{?dist}
1010
License: BSD and MIT and Public Domain and NAIST-2003 and Artistic-2.0
1111
Group: Applications/System
1212
Vendor: Microsoft Corporation
@@ -18,6 +18,7 @@ URL: https://github.com/nodejs/node
1818
Source0: https://nodejs.org/download/release/v%{version}/node-v%{version}.tar.xz
1919
Patch0: CVE-2023-21100.patch
2020
Patch1: CVE-2024-21538.patch
21+
Patch2: CVE-2025-22150.patch
2122
BuildRequires: brotli-devel
2223
BuildRequires: coreutils >= 8.22
2324
BuildRequires: gcc
@@ -118,6 +119,9 @@ make cctest
118119
%{_datadir}/systemtap/tapset/node.stp
119120

120121
%changelog
122+
* Wed Feb 05 2025 Kanishk Bansal <[email protected]> - 18.20.3-3
123+
- Patch CVE-2025-22150
124+
121125
* Tue Nov 19 2024 Bala <[email protected]> - 18.20.3-2
122126
- Patch CVE-2024-21538
123127

0 commit comments

Comments
 (0)