Skip to content

rehype-katex: allow katex >=0.18.2 (GHSA-238p-pmpm-9mq7) #121

Open

Description

@sadra-barikbin

katex versions below 0.18.2 are affected by GHSA-238p-pmpm-9mq7 ("Existing prototype pollution can bypass trust restrictions", low severity, published 2026-10-05). The first patched release is katex@0.18.2; the current release is 0.19.0.

rehype-katex@7.0.1 (and micromark-extension-math@3.1.0, which remark-math uses) declare katex: ^0.16.0, so dependents cannot pick up the patched KaTeX without a package-manager override, and npm audit / pnpm audit keep reporting the advisory for every app that renders math through this stack. Downstream example: streamdown / @streamdown/math (Vercel) depend on rehype-katex@^7.0.1.

Would it be possible to widen the katex range to include the patched line (e.g. ^0.16.0 || ^0.18.2 || ^0.19.0, if the API surface rehype-katex uses is unchanged) or to cut a release against katex@^0.18.2?

Thanks for maintaining these packages!

Activity

  1. added
    👋 phase/newPost is being triaged automatically
    🤞 phase/openPost is being triaged manually
    and removed
    👋 phase/newPost is being triaged automatically
    on Oct 6, 2026
  2. emre-mutlu commented on Oct 11, 2026

    @emre-mutlu

    Data point from a downstream app: we run rehype-katex@7.0.1 with katex@0.19.0 through a pnpm override (katex: ^0.19.0); both rehype-katex and micromark-extension-math resolve to that single copy, and pnpm audit no longer reports GHSA-238p-pmpm-9mq7.

    Our tests pass unchanged, with no API change on our side:

    • inline and display math (katex, katex-mathml, katex-html, katex-display output)
    • the error path: $\frac{1}{$ yields a katex-error span with a ParseError title and a vfile message from rehype-katex; a valid formula later in the same paragraph still renders
    • the default trust: false: \href{javascript:…} produces no href

    Setup: unified 11.0.5, remark-math 6.0.0, remark-rehype 11.1.2, Node 24. Not covered: macros, mhchem, strict options, the 0.18.x line, and micromark-extension-math's own HTML compile path (we only go through rehype-katex).

  3. added a commit that references this issue on Oct 14, 2026
    d88c74d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🤞 phase/openPost is being triaged manually

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions