Skip to content

Commit 06b9340

Browse files
js-jquery: Patch CVE-2019-20149 in kind-of (#10086)
Co-authored-by: Mykhailo Bykhovtsev <108374904+mbykhovtsev-ms@users.noreply.github.com>
1 parent 4308a0c commit 06b9340

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 638d1c5d1c33b4383a4e307f5bcb8b366dd36071 Mon Sep 17 00:00:00 2001
2+
From: Amrita Kohli <amritakohli@microsoft.com>
3+
Date: Fri, 9 Aug 2024 16:19:34 +0000
4+
Subject: [PATCH] Modified upstream patch from PR https://github.com/jonschlinkert/kind-of/pull/31 with commit id
5+
975c13a7cfaf25d811475823824af3a9c04b0ba8 for CVE-2019-20149. Modified by:
6+
Amrita Kohli <amritakohli@microsoft.com>
7+
8+
---
9+
node_modules/kind-of/index.js | 2 +-
10+
1 file changed, 1 insertion(+), 1 deletion(-)
11+
12+
diff --git a/node_modules/kind-of/index.js b/node_modules/kind-of/index.js
13+
index dfa799b7..bdcfdc85 100644
14+
--- a/node_modules/kind-of/index.js
15+
+++ b/node_modules/kind-of/index.js
16+
@@ -66,7 +66,7 @@ module.exports = function kindOf(val) {
17+
};
18+
19+
function ctorName(val) {
20+
- return typeof val.constructor === 'function' ? val.constructor.name : null;
21+
+ return val.constructor && typeof val.constructor === 'function' ? val.constructor.name : null;
22+
}
23+
24+
function isArray(val) {
25+
--
26+
2.34.1
27+

SPECS-EXTENDED/js-jquery/js-jquery.spec

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Vendor: Microsoft Corporation
22
Distribution: Mariner
33
Name: js-jquery
44
Version: 3.5.0
5-
Release: 3%{?dist}
5+
Release: 4%{?dist}
66
Summary: JavaScript DOM manipulation, event handling, and AJAX library
77
BuildArch: noarch
88

@@ -18,6 +18,8 @@ Source1: jquery_%{version}_node_modules.tar.gz
1818

1919
# disable gzip-js during build
2020
Patch1: %{name}-disable-gzip-js.patch
21+
# Patch for CVE-2019-20149 in kind-of package https://github.com/jonschlinkert/kind-of/pull/31
22+
Patch2: CVE-2019-20149.patch
2123

2224

2325
BuildRequires: web-assets-devel
@@ -45,14 +47,15 @@ browsers. With a combination of versatility and extensibility, jQuery has
4547
changed the way that millions of people write JavaScript.
4648

4749
%prep
48-
%autosetup -n jquery-%{version} -v -p1
50+
%setup -n jquery-%{version}
51+
%patch1 -p1
4952

5053
#remove precompiled stuff
5154
rm -rf dist/*
5255

5356
# Install the cached node modules
5457
tar xf %{SOURCE1}
55-
58+
%patch2 -p1
5659

5760
%build
5861
./node_modules/grunt-cli/bin/grunt -v 'build:*:*' uglify
@@ -83,6 +86,10 @@ ln -s %{version} %{installdir}/%{ver_x}.%{ver_y}
8386

8487

8588
%changelog
89+
* Fri Aug 9 2024 Amrita Kohli <amritakohli@microsoft.com> - 3.5.0-4
90+
- Patch CVE-2019-20149 in kind-of package.
91+
- License verified
92+
8693
* Mon Jun 14 2021 Thomas Crain <thcrain@microsoft.com> - 3.5.0-3
8794
- Initial CBL-Mariner import from Fedora 32 (license: MIT).
8895
- Add explicit build-time dependency on nodejs-devel

0 commit comments

Comments
 (0)