Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions client-participation/js/3rdparty/jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -8288,6 +8288,11 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) {
// Convert response if prev dataType is non-auto and differs from current
} else if ( prev !== "*" && prev !== current ) {

// Mitigate possible XSS vulnerability (gh-2432)
if ( s.crossDomain && current === "script" ) {
continue;
}

// Seek a direct converter
conv = converters[ prev + " " + current ] || converters[ "* " + current ];

Expand Down
1 change: 1 addition & 0 deletions client-participation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "polis-client-participation",
"version": "1.0.0",
"scripts": {
"test": "node scripts/verify-jquery-cve-2015-9251.cjs",
"start": "npm run dev",
"analyze": "webpack --mode=production --analyze",
"build": "npm run build:prod",
Expand Down
20 changes: 20 additions & 0 deletions client-participation/scripts/verify-jquery-cve-2015-9251.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"use strict";

/**
* Regression guard for CVE-2015-9251 mitigation in vendored jQuery (ajaxConvert).
* @see https://github.com/jquery/jquery/commit/2546bb35b89413da5198d54a4539e4ed0aaf6e49
*/
const fs = require("fs");
const path = require("path");

const jqueryPath = path.join(__dirname, "..", "js", "3rdparty", "jquery.js");
const src = fs.readFileSync(jqueryPath, "utf8");

if (!src.includes('s.crossDomain && current === "script"')) {
console.error(
"verify-jquery-cve-2015-9251: expected gh-2432 / CVE-2015-9251 guard in ajaxConvert"
);
process.exit(1);
}

console.log("verify-jquery-cve-2015-9251: ok");