Closed renovate[bot] closed 2 months ago
Latest commit: fc6ee9537970c61baed3ed9f43fc9802278fdd4a
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
This PR contains the following updates:
0.16.10
->0.16.11
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
trust
option, or set it to forbid\includegraphics
commands."\\includegraphics"
.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 generatejavascript:
links in the output, even if thetrust
function tries to forbid this protocol viatrust: (context) => context.protocol !== 'javascript'
.Patches
Upgrade to KaTeX v0.16.10 to remove this vulnerability.
Workarounds
trust
function.context.protocol
viacontext.protocol.toLowerCase()
before attempting to check for certain protocols.trust
option.Details
KaTeX did not normalize the
protocol
entry of thecontext
object provided to a user-specifiedtrust
-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:
Currently KaTeX internally sees
file:
andFile:
URLs as different protocols, socontext.protocol
can befile
orFile
, so the above check does not suffice. A simple workaround would be:Most URL parsers normalize the scheme to lowercase. For example, RFC3986 says:
CVE-2024-28243
Impact
KaTeX users who render untrusted mathematical expressions could encounter malicious input using
\edef
that causes a near-infinite loop, despite settingmaxExpand
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.11`](https://redirect.github.com/KaTeX/KaTeX/blob/HEAD/CHANGELOG.md#01611-2024-07-02) [Compare Source](https://redirect.github.com/KaTeX/KaTeX/compare/v0.16.10...v0.16.11) ##### Features - add \emph ([#3963](https://redirect.github.com/KaTeX/KaTeX/issues/3963)) ([9f34da4](https://redirect.github.com/KaTeX/KaTeX/commit/9f34da4b3cf228a7af8134c394394d780a089f2b)), closes [#3566](https://redirect.github.com/KaTeX/KaTeX/issues/3566)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.
This PR was generated by Mend Renovate. View the repository job log.