Skip to content

fix(deps): bump katex to 0.18 to resolve prototype pollution advisory - #1107

Merged
miurla merged 2 commits into
mainfrom
fix/katex-0.18
Nov 4, 2026
Merged

miurla merged 2 commits into
mainfrom
fix/katex-0.18

Conversation

@miurla

@miurla miurla commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Resolves the Dependabot alert for the KaTeX prototype pollution advisory (patched in 0.18.2).

  • Bump the direct katex dependency from ^0.16.10 to ^0.18.2 (resolves to 0.18.11).
  • Add katex to overrides so the transitive copies from @streamdown/math, mermaid and rehype-katex (all on ^0.16.x) resolve to the same patched version. Without the override the renderer stays on 0.16.44 and the alert is not actually fixed.

Keeping one version also matters because the app imports katex/dist/katex.min.css directly while @streamdown/math does the rendering, so the stylesheet and renderer should come from the same release.

Risk

The advisory is low severity: it only applies when Object.prototype is already polluted, and Morphic passes fixed renderer options. This is a hygiene fix.

The 0.17/0.18 breaking changes are an internal __defineFunction API change and CSS class prefixing; neither affects how Morphic uses KaTeX.

Verification

  • bun lint, bun typecheck, bun format:check, bun run build pass
  • bun run test passes
  • Rendered a chat response with math in the dev server: fraction and square root lay out correctly, KaTeX fonts apply, MathML stays hidden.

Written with an agent (Claude Code, claude-opus-5-5).


Devin Review

Add an override so the copies pulled in by @streamdown/math, mermaid and
rehype-katex resolve to the same patched version as the stylesheet.
@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
morphic Ready Ready Preview Nov 4, 2026 12:42am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T00:42:36.698883Z d5c54f7 New commits
🔒 Security Review ✅ Completed 2026-11-04T00:44:22.538375Z d5c54f7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@miurla
miurla merged commit f94f761 into main Nov 4, 2026
8 checks passed
@miurla
miurla deleted the fix/katex-0.18 branch November 4, 2026 00:44

This branch was successfully deployed

1 active deployment
Preview — d5c54f78 Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant