Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F29264915
07-T221739-master.patch
Reedy (Sam Reed)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
Reedy
May 28 2019, 3:15 PM
2019-05-28 15:15:28 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
07-T221739-master.patch
View Options
From 3fbe0c712d82a52e1e4842271f4a82d2115703bd Mon Sep 17 00:00:00 2001
From: "James D. Forrester" <jforrester@wikimedia.org>
Date: Thu, 25 Apr 2019 16:12:52 -0500
Subject: [PATCH] SECURITY: resources: Patch jQuery 3.3.1 for CVE-2019-11358
Patch taken from https://github.com/DanielRuf/snyk-js-jquery-174006?files=1
and left in-repo. Note that this will break the foreign resources check,
which is not currently a unit test but was planned to become such soon.
Bug: T221739
Change-Id: I99c2be81c74a8f1d35c421f0ee43c75efb30a7d0
---
resources/lib/jquery/jquery-3.3.1.patch | 14 ++++++++++++++
resources/lib/jquery/jquery.js | 3 ++-
2 files changed, 16 insertions(+), 1 deletion(-)
create mode 100644 resources/lib/jquery/jquery-3.3.1.patch
diff --git a/resources/lib/jquery/jquery-3.3.1.patch b/resources/lib/jquery/jquery-3.3.1.patch
new file mode 100644
index 0000000000..68a4326d17
--- /dev/null
+++ b/resources/lib/jquery/jquery-3.3.1.patch
@@ -0,0 +1,14 @@
+--- jquery-3.3.1.js 2019-04-01 08:39:29.000000000 +0200
++++ jquery-3.3.1.js 2019-04-01 09:02:39.000000000 +0200
+@@ -260,8 +260,9 @@ jQuery.extend = jQuery.fn.extend = function() {
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
++ // Prevent Object.prototype pollution
+ // Prevent never-ending loop
+- if ( target === copy ) {
++ if ( name === "__proto__" || target === copy ) {
+ continue;
+ }
+
diff --git a/resources/lib/jquery/jquery.js b/resources/lib/jquery/jquery.js
index 9b5206bcc6..34a5703d80 100644
--- a/resources/lib/jquery/jquery.js
+++ b/resources/lib/jquery/jquery.js
@@ -261,8 +261,9 @@ jQuery.extend = jQuery.fn.extend = function() {
src = target[ name ];
copy = options[ name ];
+ // Prevent Object.prototype pollution
// Prevent never-ending loop
- if ( target === copy ) {
+ if ( name === "__proto__" || target === copy ) {
continue;
}
--
2.21.0
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7352448
Default Alt Text
07-T221739-master.patch (1 KB)
Attached To
Mode
T205041: Tracking bug for 1.27.6/1.30.2/1.31.2/1.32.2 security release
Attached
Detach File
Event Timeline
Log In to Comment