Description
RMarkdown depends on https://mathjax.rstudio.com/latest/MathJax.js, which points to MathJax 2.7.2.
MathJax 2.7.2 is affected by the following vulnerabilities:
https://nvd.nist.gov/vuln/detail/CVE-2018-1999024 (fixed by 2.7.4)
https://nvd.nist.gov/vuln/detail/CVE-2023-39663 (still present in 2.7.9, disputed by vendor)
I recommend the package depend on 2.7.9, which should be backwards compatible with 2.7.2. The next version after 2.7.9 is 3.0, which has many breaking changes.
We recommend cdnjs which also uses CloudFlare for delivery (and on the higher “enterprise” level!). We have been in touch with cdnjs’s maintainers and will help push future MathJax releases to cdnjs.
I recommend that RMarkdown use https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.min.js as its default instead of https://mathjax.rstudio.com/latest/MathJax.js.
In our case, we weren't using MathJax's features, so we turned MathJax off using the yaml directive output: mathjax: null. Note that the comment // initialize mathjax remains in the rendered HTML.
See https://github.com/rstudio/rmarkdown/blob/main/R/shiny.R line 385 and https://github.com/rstudio/rmarkdown/blob/main/R/html_document_base.R line 269.
Checklist
When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:
-
formatted your issue so it is easier for us to read?
-
included a minimal, self-contained, and reproducible example?
-
pasted the output from
xfun::session_info('rmarkdown')in your issue? -
upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?
-
installed and tested your bug with the development version of the rmarkdown package using
remotes::install_github("rstudio/rmarkdown")?
Activity
mmitchell-w commentedon May 21, 2024
https://forum.posit.co/t/https-mathjax-rstudio-com-latest-mathjax-js-has-security-vulnerabilities/186991
A post to RStudio to try to get them to update https://mathjax.rstudio.com/latest/MathJax.js to point to https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.min.js.
mmitchell-w commentedon May 21, 2024
See also rstudio/rstudio#11535
cderv commentedon May 21, 2024
Related also to
rstudio/rstudio#11535 is the right place to follow this, as rmarkdown defaults to using this version. Depending on the reply there, we'll consider alternative.
It is possible to change Mathjax version already using parameters in output formats in the meantime
cderv commentedon Jul 11, 2024
FWIW mathjax.rstudio.com/latest has been updated to 2.7.9
Update to 3 is another story. I'll close this, and the rstudio IDE issue still apply for provinding Mathjax 3 also.
github-actions commentedon Jan 8, 2025
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.