mkdocs icon indicating copy to clipboard operation
mkdocs copied to clipboard

Update jquery version in readthedocs base.html

Open clairetarnocai opened this issue 7 years ago • 8 comments

Would it be possible to update the JQuery version in the readthedocs base.html from the current 2.1.1 (observed in master) to 2.2.4 (the latest)?

Reason for request: The jQuery.globalEval function in JQuery version 2.1.1 presents a cross-site scriping vulnerability that apparently has been fixed in the latest version of JQuery.

File: mkdocs/mkdocs/themes/readthedocs/base.html

line 42:

clairetarnocai avatar Mar 07 '19 12:03 clairetarnocai

The latest in master is up-to-date with the latest in the upstream (Sphinx) readthedocs theme (version 0.4.1) at the time it was updated (see #1594). As it appears that the upstream theme is now at version 0.4.3, then we can update to match. A PR is welcome.

waylan avatar Mar 07 '19 14:03 waylan

Thanks. I will open a PR.

clairetarnocai avatar Mar 07 '19 14:03 clairetarnocai

Hi @clairetarnocai - jQuery 2.x is no longer supported and v2.2.4 has two security vulnerabilities. I think it'd be better to update to the latest stable version v3.3.1. REF: https://snyk.io/vuln/npm:jquery

coliff avatar Apr 09 '19 13:04 coliff

@coliff Thanks for the information re jQuery version. Unfortunately it looks like it will be a while before I can get to this.

clairetarnocai avatar Apr 09 '19 13:04 clairetarnocai

Is there any way to run the latest readthedocs with mkdocs or does it require custom changes to the theme? I just noticed the ancient jquery and it took me a while to find my way here and I was hoping for a better solution.

psifertex avatar Mar 27 '20 01:03 psifertex

@psifertex, Sphinx themes and MkDocs themes are two different things. In the case of readthedocs, the two themes share Javascript/CSS/Images, but everything else (primarily templates) is different. Additionally, we have a few hacks to make the Sphinx based JavaScript/CSS to work with MkDocs. Therefore, to update our theme, one would need to copy over the Javascript/CSS/Images from the Sphinx theme, then test throughly and adjust the hacks (and perhaps update the templates) as needed until the behavior matches. Needless to say, that is a maintenance headache which is compounded by the fact that none of the core developers use the theme.

What we need is a volunteer to take on maintenance of the theme. If anyone is interested, you should start by creating PR's to address the various open issues in the theme-readthedocs tag.

waylan avatar Mar 27 '20 15:03 waylan

Understood. I'm willing to take a crack at it, but if you could clarify any history that would help me understand the hacks required in the past that might be helpful. Or even point me to specific issues if commits are associated that would give me some insight so I'm not starting over from scratch in terms of resolving those issues.

psifertex avatar Mar 27 '20 18:03 psifertex

Hello! I am trying to use this package but it is quarantined due to the jquery version. I see the upstream Read the Docs Sphinx Theme is updated to 0.5.0 and is pulling the jquery version from Sphinx directly (see https://github.com/readthedocs/sphinx_rtd_theme/issues/789). Sphinx uses jquery version jquery-3.5.1.js while this package is still using 2.1.1 which has some security vulnerabilities as mentioned above.

amanyrath avatar Nov 17 '20 16:11 amanyrath