Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The included jquery version is vulnerable #3640

Closed
dvzrv opened this issue Sep 11, 2019 · 4 comments
Closed

The included jquery version is vulnerable #3640

dvzrv opened this issue Sep 11, 2019 · 4 comments
Assignees
Milestone

Comments

@dvzrv
Copy link

dvzrv commented Sep 11, 2019

The vendored version of jquery (1.9.1) is vulnerable to many security issues, which are tracked in CVEs:

Please note, that maybe not all of the above are actually relevant for the included jquery version. I compiled the list from what seemed relevant, going through a list of CVEs, mentioning jquery: https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=jquery

However, this shows, that updating the vendored version would be a good idea! :)

@muxator
Copy link
Contributor

muxator commented Sep 16, 2019

That's right, @dvzrv.

Indeed, as of current develop (b3d8f85), the vendored jquery version is 1.9.1 from 2013-02-04.
jQuery 1.x branch is EOLed, as well (jquery/jquery.com#162).

As a stopgap measure, we can try to upgrade to the latest jQuery 1.x version, 1.12.4 from 2016-05-20.

Unfortunately, simply replacing src/static/js/jquery.js with the new version is not enough, since Etherpad whines with:

TypeError: window.$ is undefined in http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define (line 11420)

I'll see if there is a proper fix.

@muxator
Copy link
Contributor

muxator commented Sep 16, 2019

I think I found the solution, taking inspiration from this Parcel issue:

$ hg diff src/static/js/rjquery.js
diff --git a/src/static/js/rjquery.js b/src/static/js/rjquery.js
--- a/src/static/js/rjquery.js
+++ b/src/static/js/rjquery.js
@@ -1,5 +1,5 @@
 
 // Proviedes a require'able version of jQuery without leaking $ and jQuery;
-require('./jquery');
+window.$ = require('./jquery');
 var jq = window.$.noConflict(true);
 exports.jQuery = exports.$ = jq;

@muxator muxator self-assigned this Sep 16, 2019
@muxator muxator added this to the 1.8 milestone Sep 16, 2019
@lpagliari
Copy link
Contributor

Great job, @muxator!

@dvzrv
Copy link
Author

dvzrv commented Sep 17, 2019

@muxator thanks for looking into this so fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants