Skip to content

Commit 996f147

Browse files
committed
✨ jQuery v1.8.4-sec
1 parent c81851f commit 996f147

File tree

4 files changed

+67
-15
lines changed

4 files changed

+67
-15
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In a perfect world, at least every MAJOR EOL jQuery release line would have a se
1414
|| `1.5.2` | `1.5.3-sec` | [1.5.3-sec] | [PR][1.5.3-pr] | | [CVE-2011-4969] \| [CVE-2012-6708] \| [CVE-2015-9251] \| [CVE-2019-11358] \| [CVE-2020-7656] \| [CVE-2020-11022] \| [CVE-2020-11023] |
1515
|| `1.6.4` | `1.6.5-sec` | [1.6.5-sec] | [PR][1.6.5-pr] | | [CVE-2012-6708] \| [CVE-2015-9251] \| [CVE-2019-11358] \| [CVE-2020-7656] \| [CVE-2020-11022] \| [CVE-2020-11023] |
1616
|| `1.7.2` | `1.7.3-sec` | [1.7.3-sec] | [PR][1.7.3-pr] | | [CVE-2012-6708] \| [CVE-2015-9251] \| [CVE-2019-11358] \| [CVE-2020-7656] \| [CVE-2020-11022] \| [CVE-2020-11023] |
17-
| 🚧 | `1.8.3` | `1.8.4-sec` | | | | [CVE-2012-6708] \| [CVE-2015-9251] \| [CVE-2019-11358] \| [CVE-2020-7656] \| [CVE-2020-11022] \| [CVE-2020-11023] |
17+
| | `1.8.3` | `1.8.4-sec` | [1.8.4-sec] | [PR][1.8.4-pr] | | [CVE-2012-6708] \| [CVE-2015-9251] \| [CVE-2019-11358] \| [CVE-2020-7656] \| [CVE-2020-11022] \| [CVE-2020-11023] |
1818
| 🚧 | `1.12.4` | `1.12.5-sec` | | | | [CVE-2015-9251] \| [CVE-2019-11358] \| [CVE-2020-11022] \| [CVE-2020-11023] |
1919
| 🚧 | `2.2.4` | `2.2.5-sec` | | | | [CVE-2015-9251] \| [CVE-2019-11358] \| [CVE-2020-11022] \| [CVE-2020-11023] \| [CVE-2020-23064] |
2020

@@ -70,6 +70,8 @@ Ultimately, our hope is that these patched versions can be approved and accepted
7070
[1.6.5-pr]: https://github.com/ctcpip/jquery-security-patches/pull/1
7171
[1.7.3-sec]: https://github.com/ctcpip/jquery-security-patches/tree/1.7.3-sec
7272
[1.7.3-pr]: https://github.com/ctcpip/jquery-security-patches/pull/7
73+
[1.8.4-sec]: https://github.com/ctcpip/jquery-security-patches/tree/1.8.4-sec
74+
[1.8.4-pr]: https://github.com/ctcpip/jquery-security-patches/pull/8
7375
[CVE-2011-4969]: https://github.com/advisories/GHSA-579v-mp3v-rrw5
7476
[CVE-2012-6708]: https://github.com/advisories/GHSA-2pqj-h3vj-pqgw
7577
[CVE-2015-9251]: https://github.com/advisories/GHSA-rmxg-73gg-4p98

security/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
88
## Prerequisites
99

10+
- [Make](https://en.wikipedia.org/wiki/Make_(software))
11+
- Node.js
12+
- Node v20, the current LTS version at the time of this writing is the version used, although you may be successful with other versions
1013
- For older jQuery versions (1.2.6 through 1.5.2<!-- update as needed -->), you'll need to install php 5.6
1114
- For Macs, We recommend using [homebrew-php](https://github.com/shivammathur/homebrew-php)
1215

@@ -54,6 +57,7 @@
5457
- Checkout the `1.5.2` or `1.5.3-sec` branch
5558
- From the root folder of the repo:
5659
- `git submodule update --recursive`
60+
- if you get errors updating submodules, you may need to search for `[submodule` and update git:// urls to https://
5761
- `cd test`
5862
- Create symlink to src in test folder:
5963
- `ln -s ../src src`
@@ -68,6 +72,7 @@
6872
- Checkout the `1.6.4` or `1.6.5-sec` branch
6973
- From the root folder of the repo:
7074
- `git submodule update --recursive`
75+
- if you get errors updating submodules, you may need to search for `[submodule` and update git:// urls to https://
7176
- Run php server:
7277
- `php -S 127.0.0.1:8000 -t test`
7378
- Open `127.0.0.1:8000/tests/index.html` in your browser
@@ -77,6 +82,31 @@
7782
- Checkout the `1.7.2` or `1.7.3-sec` branch
7883
- From the root folder of the repo:
7984
- `git submodule update --recursive`
85+
- if you get errors updating submodules, you may need to search for `[submodule` and update git:// urls to https://
86+
- Run php server:
87+
- `php -S 127.0.0.1:8000 -t test`
88+
- Open `127.0.0.1:8000/tests/index.html` in your browser
89+
90+
#### 1.8.3 / 1.8.4-sec
91+
92+
- Checkout the `1.8.3` or `1.8.4-sec` branch
93+
- From the root folder of the repo:
94+
- `git submodule update --recursive`
95+
- If you get errors updating submodules, you may need to search for `[submodule` and update git:// urls to https://
96+
- Globally install the requisite ancient version of grunt: `npm i grunt@0.3.9 -g`
97+
- `npm i`
98+
- Modify the `grunt.js` file
99+
- Remove `submodules` from the default grunt task
100+
- Remove `compare_size` from default grunt task
101+
- Run `grunt`
102+
- You should get errors about `path.existsSync()` in `node_modules/grunt/lib/util/findup.js` and in `node_modules/grunt/bin/grunt`
103+
- Modify both files to `require('fs')` and change `path.existsSync()` to `fs.existsSync()`
104+
- Run `grunt`
105+
- It should work now
106+
- `cd test`
107+
- Create symlink to dist in test folder:
108+
- `ln -s ../dist dist`
109+
- `cd ..`
80110
- Run php server:
81111
- `php -S 127.0.0.1:8000 -t test`
82112
- Open `127.0.0.1:8000/tests/index.html` in your browser
@@ -145,3 +175,20 @@ You can run the A/B tests locally in CI mode or manually in the browser
145175
- From the root folder of the repo:
146176
- Run `make`
147177
- This will output `./dist/jquery.js`
178+
179+
#### 1.8.3 / 1.8.4-sec
180+
181+
- Checkout the `1.8.3` or `1.8.4-sec` branch
182+
- From the root folder of the repo:
183+
- `git submodule update --recursive`
184+
- If you get errors updating submodules, you may need to search for `[submodule` and update git:// urls to https://
185+
- Globally install the requisite ancient version of grunt: `npm i grunt@0.3.9 -g`
186+
- `npm i`
187+
- Modify the `grunt.js` file
188+
- Remove `submodules` from the default grunt task
189+
- Remove `compare_size` from default grunt task
190+
- Run `grunt`
191+
- You should get errors about `path.existsSync()` in `node_modules/grunt/lib/util/findup.js` and in `node_modules/grunt/bin/grunt`
192+
- Modify both files to `require('fs')` and change `path.existsSync()` to `fs.existsSync()`
193+
- Run `grunt`
194+
- This will output `./dist/jquery.js`

security/site/vendor/jquery-1.8.4-sec.js

100644100755
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery JavaScript Library v1.8.3
2+
* jQuery JavaScript Library v1.8.4-sec
33
* http://jquery.com/
44
*
55
* Includes Sizzle.js
@@ -9,7 +9,7 @@
99
* Released under the MIT license
1010
* http://jquery.org/license
1111
*
12-
* Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time)
12+
* Date: Sat Feb 17 2024 00:41:53 GMT-0600 (Central Standard Time)
1313
*/
1414
(function( window, undefined ) {
1515
var
@@ -55,8 +55,10 @@ var
5555
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
5656

5757
// A simple way to check for HTML strings
58-
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
59-
rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
58+
// Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
59+
// Strict HTML recognition (trac-11290: must start with <)
60+
// Shortcut simple #id case for speed
61+
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w\-]+))$/,
6062

6163
// Match a standalone tag
6264
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
@@ -322,8 +324,9 @@ jQuery.extend = jQuery.fn.extend = function() {
322324
src = target[ name ];
323325
copy = options[ name ];
324326

327+
// Prevent Object.prototype pollution
325328
// Prevent never-ending loop
326-
if ( target === copy ) {
329+
if ( name === "__proto__" || target === copy ) {
327330
continue;
328331
}
329332

@@ -5664,7 +5667,6 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca
56645667
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
56655668
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
56665669
rleadingWhitespace = /^\s+/,
5667-
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
56685670
rtagName = /<([\w:]+)/,
56695671
rtbody = /<tbody/i,
56705672
rhtml = /<|&#?\w+;/,
@@ -5677,7 +5679,6 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca
56775679
rscriptType = /\/(java|ecma)script/i,
56785680
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
56795681
wrapMap = {
5680-
option: [ 1, "<select multiple='multiple'>", "</select>" ],
56815682
legend: [ 1, "<fieldset>", "</fieldset>" ],
56825683
thead: [ 1, "<table>", "</table>" ],
56835684
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
@@ -5689,7 +5690,6 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca
56895690
safeFragment = createSafeFragment( document ),
56905691
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
56915692

5692-
wrapMap.optgroup = wrapMap.option;
56935693
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
56945694
wrapMap.th = wrapMap.td;
56955695

@@ -5882,8 +5882,6 @@ jQuery.fn.extend({
58825882
( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
58835883
!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
58845884

5885-
value = value.replace( rxhtmlTag, "<$1></$2>" );
5886-
58875885
try {
58885886
for (; i < l; i++ ) {
58895887
// Remove element nodes and prevent memory leaks
@@ -6315,9 +6313,6 @@ jQuery.extend({
63156313
div = context.createElement("div");
63166314
safe.appendChild( div );
63176315

6318-
// Fix "XHTML"-style tags in all browsers
6319-
elem = elem.replace(rxhtmlTag, "<$1></$2>");
6320-
63216316
// Go to html and back, then peel off extra wrappers
63226317
tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
63236318
wrap = wrapMap[ tag ] || wrapMap._default;
@@ -7288,7 +7283,7 @@ var
72887283
rnoContent = /^(?:GET|HEAD)$/,
72897284
rprotocol = /^\/\//,
72907285
rquery = /\?/,
7291-
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
7286+
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*< *\/ *script *>?/gi,
72927287
rts = /([?&])_=[^&]*/,
72937288
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
72947289

@@ -8245,6 +8240,13 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
82458240
return "script";
82468241
}
82478242
});
8243+
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
8244+
jQuery.ajaxPrefilter( function( s ) {
8245+
if ( s.crossDomain ) {
8246+
s.contents.script = false;
8247+
}
8248+
} );
8249+
82488250
// Install script dataType
82498251
jQuery.ajaxSetup({
82508252
accepts: {

security/test/test.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const patchedVersions = [
1313
'1.5.3-sec',
1414
'1.6.5-sec',
1515
'1.7.3-sec',
16+
'1.8.4-sec',
1617
];
1718

1819
function banner(txt, {borderColor = 'magenta', textColor = 'cyan'} = {borderColor: 'magenta', textColor: 'cyan'}) {

0 commit comments

Comments
 (0)