-
-
Notifications
You must be signed in to change notification settings - Fork 401
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
Upgrade jquery from v1.7.1 to v1.9.0 to fix security vulnerability #1351
Upgrade jquery from v1.7.1 to v1.9.0 to fix security vulnerability #1351
Conversation
This is a lot less ambitious than lsegal#1294 and so hopefully shouldn't introduce any problems. The idea is to do just enough to address the CVE-2017-16011 security vulnerability [1]. I downloaded the jquery JS from here [2]. [1]: GHSA-2pqj-h3vj-pqgw [2]: https://code.jquery.com/jquery-1.9.0.min.js
Bump! Any chance of getting this merged? Thanks. |
As per this commit [1] in this as yet unmerged PR [2]. Fixes CVE-2017-16011 security vulnerability [3]. I've also added a new rake task into the generate_docs prerequisites to revert the jquery.js file generated by yard to the one in the git repo, because until the yard PR is merged and released the jquery.js file would be overwritten by the v1.7.1 version every time the docs were generated. [1]: freerange/yard@065d5dc [2]: lsegal/yard#1351 [3]: GHSA-2pqj-h3vj-pqgw
In case anyone else has run into this problem, I've worked around it temporarily here: freerange/mocha@211098a. |
I've only just noticed that jquery v1.9.0 introduces a problem with the "toggle source" links. I've downgraded jquery to v1.8.3 in my own project and that seems to fix the problem. I'm going to continue to investigate whether there's a way to upgrade back to v1.9.0, because that's the version that fixes the security vulnerability. |
I've defined a jquery function called oldToggle closely based on the code in the jquery-migrate plugin [1] as recommended here [2]. I'm sure this code could be made a lot better, but this seems to fix my current problem. [1]: https://github.com/jquery/jquery-migrate/blob/1.x-stable/src/event.js#L72-L103 [2]: https://github.com/jquery/jquery-migrate/blob/1.x-stable/warnings.md#jqmigrate-jqueryfntogglehandler-handler-is-deprecated
I've now pushed another commit which fixes the fact that the version of the jquery toggle function which takes 2 functions as arguments was removed in jquery v1.9.0. See the commit note for more details: e6d2492. |
Ideally this would be fixed in yard. I've opened a PR [1] with the fix, but haven't yet had any response at all - hence why I'm patching this. Note that we now have to checkout both app.js & jquery.js after the docs are generated in order to override the versions of these files generated by yard. [1]: lsegal/yard#1351
This fixes an error I was seeing in Chrome developer tools.
Thanks for your response on Twitter. From this tweet:
OK. In case it helps, I used the jQuery Migrate plugin to work out why the "view source" functionality wasn't working and the And from this tweet:
Sounds sensible, but I'm not sure whether I'll have time to work on that any time soon. |
YARD can generate guide based templates too (via It's more unfortunate that (a) YARD is a little outdated by using jQuery in general, and (b) jQuery has decided to make breaking changes in the middle of major versions, meaning in order to get this fix we'd need to incorporate breaking changes. That said, as mentioned above (and here) the actual impact of this jQuery vulnerability might be pretty low for YARD, a tool that already allows devs to put whatever they want inside a generated HTML document. It also may be that this vulnerability doesn't affect YARD at all. I cannot guarantee this, but it doesn't look like YARD generates selectors from user inputs in any place other than TOC id/toc-id attributes, which tend to be generated by other sanitizing tools (markdown, etc). This probably affects sites that serve output a little more (like rubydoc.info), but even there we don't necessarily block people from customizing frontend, or at least, the goal is to allow developers to affect HTML up-to-and-including adding extra scripting into a page, so this might be something downstream consumers need to take on. Quite frankly, if XSS is a concern for user generated content, those who use YARD in this way should realize that the tool allows for quite liberal generation on content, including, for example, rendering a Until this is patched for affected downstream usage, interested users could replace the |
@lsegal Thanks for explaining. Sorry not to respond sooner. I'm going to close this PR. |
Description
This is a lot less ambitious than #1294 and so hopefully shouldn't
introduce any problems. The idea is to do just enough to address the
CVE-2017-16011 security vulnerability.
I downloaded the jquery JS from here.
Completed Tasks
bundle exec rake
locally (if code is attached to PR).