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

fix(deps): update dependency katex to ^0.16.0 [security] #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Mar 26, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
katex (source) ^0.11.1 -> ^0.16.0 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-28245

Impact

KaTeX users who render untrusted mathematical expressions could encounter malicious input using \includegraphics that runs arbitrary JavaScript, or generate invalid HTML.

Patches

Upgrade to KaTeX v0.16.10 to remove this vulnerability.

Workarounds

  • Avoid use of or turn off the trust option, or set it to forbid \includegraphics commands.
  • Forbid inputs containing the substring "\\includegraphics".
  • Sanitize HTML output from KaTeX.

Details

\includegraphics did not properly quote its filename argument, allowing it to generate invalid or malicious HTML that runs scripts.

For more information

If you have any questions or comments about this advisory:

CVE-2024-28246

Impact

Code that uses KaTeX's trust option, specifically that provides a function to block-list certain URL protocols, can be fooled by URLs in malicious inputs that use uppercase characters in the protocol. In particular, this can allow for malicious input to generate javascript: links in the output, even if the trust function tries to forbid this protocol via trust: (context) => context.protocol !== 'javascript'.

Patches

Upgrade to KaTeX v0.16.10 to remove this vulnerability.

Workarounds

  • Allow-list instead of block protocols in your trust function.
  • Manually lowercase context.protocol via context.protocol.toLowerCase() before attempting to check for certain protocols.
  • Avoid use of or turn off the trust option.

Details

KaTeX did not normalize the protocol entry of the context object provided to a user-specified trust-function, so it could be a mix of lowercase and/or uppercase letters.

It is generally better to allow-list by protocol, in which case this would normally not be an issue. But in some cases, you might want to block-list, and the KaTeX documentation even provides such an example:

Allow all commands but forbid specific protocol: trust: (context) => context.protocol !== 'file'

Currently KaTeX internally sees file: and File: URLs as different protocols, so context.protocol can be file or File, so the above check does not suffice. A simple workaround would be:

trust: (context) => context.protocol.toLowerCase() !== 'file'

Most URL parsers normalize the scheme to lowercase. For example, RFC3986 says:

Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. An implementation should accept uppercase letters as equivalent to lowercase in scheme names (e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce lowercase scheme names for consistency.

CVE-2024-28243

Impact

KaTeX users who render untrusted mathematical expressions could encounter malicious input using \edef that causes a near-infinite loop, despite setting maxExpand to avoid such loops. This can be used as an availability attack, where e.g. a client rendering another user's KaTeX input will be unable to use the site due to memory overflow, tying up the main thread, or stack overflow.

Patches

Upgrade to KaTeX v0.16.10 to remove this vulnerability.

Workarounds

Forbid inputs containing the substring "\\edef" before passing them to KaTeX.
(There is no easy workaround for the auto-render extension.)

Details

KaTeX supports an option named maxExpand which prevents infinitely recursive macros from consuming all available memory and/or triggering a stack overflow error. However, what counted as an "expansion" is a single macro expanding to any number of tokens. The expand-and-define TeX command \edef can be used to build up an exponential number of tokens using only a linear number of expansions according to this definition, e.g. by repeatedly doubling the previous definition. This has been corrected in KaTeX v0.16.10, where every expanded token in an \edef counts as an expansion.

For more information

If you have any questions or comments about this advisory:


Release Notes

KaTeX/KaTeX (katex)

v0.16.10

Compare Source

Bug Fixes

v0.16.9

Compare Source

Features

v0.16.8

Compare Source

Features
  • expose error length and raw error message on ParseError (#​3820) (710774a)

v0.16.7

Compare Source

Bug Fixes

v0.16.6

Compare Source

Bug Fixes

v0.16.5

Compare Source

Features

v0.16.4

Compare Source

Bug Fixes

v0.16.3

Compare Source

Bug Fixes

v0.16.2

Compare Source

Bug Fixes

v0.16.1

Compare Source

Bug Fixes

v0.16.0

Compare Source

Bug Fixes
  • copy-tex: Use JS (instead of CSS) to select full equation, solving display glitches (#​3586) (8c2d852)
BREAKING CHANGES
  • copy-tex: copy-tex extension no longer has (or requires) a CSS file.

0.15.6 (2022-05-20)

Features

0.15.5 (2022-05-20)

Bug Fixes

0.15.4 (2022-05-20)

Features

0.15.3 (2022-03-13)

Bug Fixes

0.15.2 (2022-01-12)

Bug Fixes

0.15.1 (2021-10-31)

Features

v0.15.6

Compare Source

Features

v0.15.5

Compare Source

Bug Fixes

v0.15.4

Compare Source

Features

v0.15.3

Compare Source

Bug Fixes

v0.15.2

Compare Source

Bug Fixes

v0.15.1

Compare Source

Features

v0.15.0

Compare Source

Features
BREAKING CHANGES
  • \relax is now implemented as a function. It'll stop
    expansions and parsing, so the behavior around \relax may change.
    For example, \kern2\relax em will no longer work.

0.14.1 (2021-10-30)

Bug Fixes

v0.14.1

Compare Source

Bug Fixes

v0.14.0

Compare Source

Features
BREAKING CHANGES
  • With module loaders that support conditional exports
    and ECMAScript modules, import katex from 'katex'; will import the
    ECMAScript module.

You can now use:

Before After
require('katex/dist/contrib/[name].js') require('katex/contrib/[name]')
import katex from 'katex/dist/katex.mjs' import katex from 'katex'
import 'katex/dist/contrib/[name].mjs' import 'katex/contrib/[name]'

0.13.24 (2021-10-30)

Bug Fixes

0.13.23 (2021-10-30)

Bug Fixes

0.13.22 (2021-10-30)

Bug Fixes
  • deps: update dependency commander to v8 [skip netlify] (#​3374) (4df1922)

0.13.21 (2021-10-29)

Bug Fixes

0.13.20 (2021-10-26)

Performance Improvements

0.13.19 (2021-10-26)

Features

0.13.18 (2021-09-02)

Features

0.13.17 (2021-09-01)

Bug Fixes

0.13.16 (2021-08-28)

Bug Fixes

0.13.15 (2021-08-28)

Features

0.13.14 (2021-08-28)

Bug Fixes

0.13.13 (2021-07-21)

Bug Fixes
  • add namespace for svg, making output XHTML+SVG+MathML compatible (#​2725) (35ff5ac)

0.13.12 (2021-07-21)

Bug Fixes

0.13.11 (2021-05-14)

Bug Fixes
Features

0.13.10 (2021-05-12)

Bug Fixes
  • Correct for negative margin in integrand lower limits (#​2987) (9b4acc9)

0.13.9 (2021-05-07)

Bug Fixes

0.13.8 (2021-05-06)

Features
  • \operatornamewithlimits (and clean up \operatorname support) (#​2984) (e9b751b)

0.13.7 (2021-05-06)

Bug Fixes

0.13.6 (2021-05-06)

Bug Fixes

0.13.5 (2021-05-02)

Bug Fixes

0.13.4 (2021-05-02)

Bug Fixes

0.13.3 (2021-04-24)

Bug Fixes

0.13.2 (2021-04-06)

Bug Fixes

0.13.1 (2021-04-05)

Bug Fixes

[v0.13.0]

See https://github.com/KaTeX/KaTeX/issues/2490 for breaking changes and migration guide!
Bug Fixes
  • fix: Remove topEnv parameter. (#​2712)
  • fix(builder): combine characters together in all expressions (#​2080)
  • fix: Prevent global group from adversely affecting color. (#​2703)
  • fix: Use SVGs to avoid gaps in tall delimiters. (#​2698)
  • fix: rewrite of splitAtDelimiters.js -- new fix for #​2523 (#​2679)
  • fix: Improve MathML for math operators with subscripts (#​2596)
  • fix: Remove premature CD screenshotter images (#​2641)
  • fix: Support Armenian characters (#​2618)
  • fix: MathML \lim\limits in Safari (#​2556)
  • fix: Support MathML \oiint and \oiiint (#​2461)
  • fix: \injlim typo (#​2459)
Features
  • feat: Support \underbar (#​2713)
  • feat: Add {CD} to auto-render. (#​2710)
  • feat: Set Auto-render to recognize AMS environments without $$…$$ delimiters. (#​2701)
  • feat: Support {CD} (#​2396)
  • feat: Support \vcenter and \hbox (#​2452)
  • feat(function): add allowedInArgument instead of greediness property (#​2134)
  • feat: Support matrix*, pmatrix*, bmatrix*, Bmatrix*, vmatrix*, and Vmatrix*. (#​2488)
  • feat(macro): improve argument parsing (#​2085)
  • feat: support AMS log-like symbols (#​2429)
  • feat: support Unicode ◯, U+25EF (#​2430)
  • feat: Support \phase (#​2406)
  • feat: Support \mathstrut (#​2416)
  • feat: support {equation}, {equation*}, and {split} (#​2369)
  • feat(css): use postcss-preset-env (#​2313)
  • feat: support {align}, {align*}, {alignat}, and {alignat*} (#​2341)
  • Support {gather} and {gather*} (#​2183)
  • feat: support MathML \big, \bigg, \Big, and \Bigg (#​2332)
  • feat: support \angl and \angln (#​2334)
  • Support \origof and \imageof (#​2283)
Documentation
  • docs: Add TiddlyWiki to list of users (#​2765)
  • docs: Fix fallback CSS classes (#​2809)
  • docs: Rearrange environment documentation. (#​2700)
  • docs: Explain how to make macros persist. (#​2702)
  • docs: Revise placement of colonequals in Relations table (#​2704)
  • docs: delete stray backtick (#​2680)
  • docs: Add colonequals functions to docs (#​2651)
  • docs: add new user link (#​2597)
  • fix: typo in example on homepage (#​2577)
  • docs: Add \char to support_table. (#​2620)
  • docs: Update \operatorname in supported_table.md 0.12.0 (#​2571)
  • docs: Fix documentation typo in operatorname* (#​2570)
  • docs: add warning re:defer to mhchem documentation (#​2485)
  • docs: update Gatsby logo and link (#​2481)
  • docs: add MonsterWriter to the users page (#​2478)
  • docs: add comment re: \arrowvert (#​2449)
  • docs: add link to Discussions (#​2405)
  • Update \color documentation (#​2370)
  • docs: add Marker as a KaTeX user (#​2329)
Other Changes
  • ci: run screenshotter in container (#​2644)
  • ci: setup CodeQL code scanning (#​2645)
  • fix(browserslist): remove Chrome 49, Samsung 4, and Node (#​2591)
  • chore: add devcontainer.json (#​2545)
  • Configure Renovate (#​2493)
  • ci: don't persist credentials and run scripts (#​2450)
  • build: upgrade Yarn to 2.2.0 (#​2477)
  • build: make vscode work with PnP (#​2444)
  • refactor: Delete obsolete comment re: mn elements (#​2472)
  • test: lint all js files and inline scripts in workflow (#​2442)
  • refactor: Delete obsolete comment re: limsup (#​2464)
  • ci: migrate to GitHub Actions from CircleCI, allow running Browserstack on forked repo via label (#​2417)
  • ci: enable Dependabot for website, submodules, and GitHub Actions (#​2424)
  • test: add missing screenshots for safari (#​2423)
  • ci: fix Dependabot autofix (#​2400)
  • chore: don't include dist in the release commit (#​2385)
  • ci: autofix Dependabot commits (#​2394)
  • chore(screenshotter): support Browserstack and test on Safari 13.1 (#​2306)
  • chore: enable Gitpod (#​2335)
  • chore: migrate to Yarn 2 (#​2316)
  • test: mock console implementation (#​2363)
  • Update LICENSE year (#​2374)
  • test(screenshotter): move coverage to Jest (#​2324)
  • Fix test/symgroups.js (#​2314)
  • Use base revision provided by CircleCI (#​2309)
  • Delete bower.json (#​2372)
  • Enable a MathML option in the KaTeX demo. (#​2371)
  • Create dependabot.yml (#​2311)
  • Run screenshotter using Chrome 83 and Firefox 76 (#​2304)

[v0.12.0]

Added
  • globalGroup option to place definitions in global scope (#​2091)
  • \cal (#​2116)
  • {rcases} and {drcases} (#​2149)
  • HTML extension (#​2082)
    • HTML extension can be enabled using strict and trust setting. See https://katex.org/docs/options.html for more details. Please review its security implication before enabling the extension.
  • \message, \errmessage, and \show for debugging (#​2135)
  • bra-ket notation (#​2162)
  • \expandafter, \noexpand, \edef, \let, and \long (#​2122)
  • Support MathML display mode (#​2220)
  • \minuso (#​2213)
Changed
Removed
  • BREAKING CHANGE: IE 9/10 support (#​2136)
Fixed
  • Set border-collapse: collapse in vlist, fix misalignment in table (#​2103)
  • \@​ifnextchar consumes spaces (#​2118)
  • Add spacing on left of fleqn display math (#​2127)
  • Fix \boxed inherited color (#​2130)
  • Fix laps having visible width in Safari (#​1919)
  • Improve MathML for corners (#​1922)
  • auto-render: ignore "option" tags (#​2180)
  • Fix delimiter error message (#​2186)
  • Fix under accent depth (#​2252)
  • Enable empty environment (#​2258)
  • Enable an empty \substack (#​2278)
  • Fix jagged parentheses (#​2234)
  • \boldsymbol not italic for textords such as Greek (#​2290, #​2299)
  • Protect fraction bars from CSS border-color (#​2292)
  • Reset to leftmost spacing mode after newline (#​1841)
  • Fix missing metrics for space (0x20) and no-break space (0xa0) (#​2298)

[v0.11.1]

Changed
  • [Security] Bump mixin-deep from 1.3.1 to 1.3.2 (#​2090)
  • [Security] Bump eslint-utils from 1.3.1 to 1.4.2 (#​2089)
Fixed
  • Fix parse timing by separating consume() into fetch() and consume() (#​2054)
  • Use current font for accents (#​2066)
  • Fix \gray's macro definition (#​2075)

[v0.11.0]

Added
  • BREAKING CHANGE: trust setting to indicate whether input text is trusted (#​1794)
    • \href and \url will break without adjusting the trust setting
  • Add test for double square brackets to katex-spec (#​1956)
  • Add option to render only MathML so that its visible (#​1966)
  • Support {smallmatrix}, {subarray}, and \substack (#​1969)
  • Enable minRuleThickness in rendering options (#​1964)
  • Add \plim (#​1952)
  • Support Unicode \digamma (#​2010)
  • Support \operatorname* (#​1899)
  • Support \includegraphics, with appropriate trust setting (#​2053)
  • Add render-a11y-string add-on (#​2062)
Changed
  • DOC: Fix path to built file (#​1976)
  • Remove unclosed TODO comment (#​1979)
  • Add "Tutti Quanti Shelf" app to users page (#​1997)
  • Document mhchem \cf not supported (use \ce instead) (#​2008)
  • Replace greenkeeper badge with dependabot badge (#​2022)
  • Add Unicode digamma to documentation (#​2045)
  • Add katex-expression to libs page (#​2049)
  • Suggest in documentation (#​2052)
  • Unicode characters in math render in text mode (#​2040)
Fixed
  • Improve output of fonts in MathML (#​1965)
  • Fix \pmb (#​1924)
  • \color affects following \right, put array cells in their own groups (#​1845)
  • Improve MathML for classes (#​1929)
  • Prevent gaps in tall delimiters (#​1986)
  • Fix \sqrt SVG path (#​2009)
  • Do not force sizing groups to display inline-block (#​2044)
  • Fix font choice in operators like \log (e.g. \boldsymbol{\log}) (#​2041)
  • Fix argument font sizing in \fbox and \raisebox, fix font sizing in \TeX, \LaTeX, \KaTeX (#​1787)

[v0.10.2]

Added
  • Approximate font metrics only when metrics don't exist (#​1898)
  • Add KaTeX version to stylesheet and troubleshooting guide (#​1893)
  • Add symbol double square brackets (#​1947, #​1954)
  • Support double-square curly braces (#​1953)
Changed
Fixed
  • Fix \Rho (#​1870)
  • Fix nested \dfrac (#​1825)
  • Improve MathML accents (#​1877)
  • Improve MathML for \overset, \stackrel, and \underset (#​1886)
  • Fix \not (U+E020) RBearing (width) (#​1878)
  • Fix ApplyFunction character (#​1890)
  • Improve MathML for \limits (#​1897)
  • Improve MathML for \hphantom and \vphantom (#​1883)
  • Improve MathML for \coloneqq, \dblcolon, \eqcolon, and \eqqcolon (#​1889)
  • Improve MathML for \brace (#​1884)
  • Fix \middle spacing (#​1906)
  • Get a tall \middle\vert from MathML (#​1911)
  • Improve more coloneq (#​1902)
  • Make \smallint small in \displaystyle (#​1907)
  • Improve MathML for characters in Unicode private use area (#​1908)
  • Improve MathML for extensible arrows (#​1901)
  • Improve MathML for \rule (#​1912)
  • Improve MathML for fractions (#​1882)
  • Improve MathML for \tag (#​1915)
  • Improve MathML for \colorbox and \fcolorbox (#​1914)
  • Improve MathML for environments (#​1910)
  • Improve MathML for \genfrac barline (#​1925)
  • Support \textup and \textmd (#​1921)
  • Improve MathML for \not (#​1923)
  • Improve MathML for \Bbbk (#​1930)
  • Prevent inadvertent tall delims (#​1948)
Removed
  • Re-added code for \includegraphics but disabled the function until trust settings is merged (#​1951)

[v0.10.1]

Added
Changed
  • Include only necessary fonts for target environment specified by Browserslist (#​1674)
Fixed
  • Support blackboard bold in text mode (#​1757)
  • Fix spacings in semisimple groups (#​1706)
  • Fix parsing comments (#​1789)
  • Fix \ and \newline after operator (#​1796)
  • Fix \hphantom width (#​1809)
  • Remove double encoding in MathML (#​1813)
  • Fix Unicode bigcup (#​1836)
  • Fix \genfrac w/ empty delimiter arguments (#​1816)
  • \fbox inherits default color (#​1847)
  • Fix \not and \neq on Chrome 72 (#​1852)

[v0.10.0]

Added
Changed

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the renovate label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants