Skip to content

chore: upgrade katex to ^0.18.2, postcss-selector-parser to ^7.1.6 to address CVE-2026-103923, CVE-2026-104844 - #1717

Merged
brendan-kellam merged 4 commits into
mainfrom
brendan/cve-katex-postcss-selector-parser
Oct 9, 2026
Merged

brendan-kellam merged 4 commits into
mainfrom
brendan/cve-katex-postcss-selector-parser

Conversation

@brendan-kellam

@brendan-kellam brendan-kellam commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes SOU-2473
Fixes SOU-2474

Summary

Neither package has a patched release inside the ranges our dependencies request, and no top-level upgrade fixes it:

Package Before After Requested by Why an override
katex 0.16.47 0.18.10 mermaid (^0.16.45) The fix is only in 0.18.2. Even the latest mermaid (12.1.0) still pins ^0.16.47.
postcss-selector-parser 6.1.4 7.1.6 tailwindcss@3 (^6.1.2), @tailwindcss/typography (^6.1.3), postcss-nested (^6.1.1) The fix is only in 7.1.6, with no 6.x backport. The only alternative is a Tailwind v4 migration.

Following the CVE guidelines, this uses qualified resolutions keys for each existing source range. The existing postcss-selector-parser@npm:6.0.10 override now also targets ^7.1.6, so a future @tailwindcss/typography bump can't bring the vulnerable range back.

Risk

katex 0.16 → 0.18. The breaking changes are an internal __defineFunction API (0.17) and prefixed CSS class names (0.18). We don't use katex directly. mermaid.core.mjs loads it with a dynamic import("katex") and only calls renderToString(str, { throwOnError, displayMode, output }), which is unchanged. We don't load katex CSS separately.

postcss-selector-parser 6 → 7. The only change in 7.0.0 is that insertions during iteration are now safe. It's used at build time, by Tailwind on our own CSS.

Testing

  • Compiled Tailwind CSS (tailwindcss -i src/app/globals.css -c tailwind.config.ts) is byte-for-byte identical before and after.
  • katex.renderToString with mermaid's options renders with both mathml and htmlAndMathml output.
  • Reproduced the advisory: with Object.prototype.trust = true, 0.16.47 renders \href{...} as a live <a href> and 0.18.10 does not.
  • vitest run src/ee/features/chat (mermaid diagram rendering): 49 files, 503 tests pass.

🤖 Generated with Claude Code


Note

Low Risk
Scoped to Yarn resolutions and lockfile; PR testing reports identical Tailwind output and passing Mermaid/chat tests, with only transitive math/CSS build tooling affected.

Overview
Addresses CVE-2026-103923 and CVE-2026-104844 by forcing patched transitive versions through Yarn resolutions, since upstream ranges (e.g. mermaid → katex, Tailwind v3 → postcss-selector-parser) do not include fixes in-tree.

katex is overridden from the ^0.16.45 line (0.16.47) to ^0.18.2 (lock: 0.18.10), used indirectly for math in Mermaid diagrams. postcss-selector-parser is overridden from 6.x to ^7.1.6 for every existing resolution key (including the legacy 6.0.10 pin), so Tailwind-related build tooling cannot pull a vulnerable 6.x build.

yarn.lock reflects the resolved versions (and commander@^15 as a katex dependency). CHANGELOG records the upgrade under Unreleased Fixed. No application source changes—dependency and lockfile maintenance only.

Reviewed by Cursor Bugbot for commit f3d2020. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Chores
    • Updated the underlying support for rendering mathematical notation and processing stylesheet selectors. No user-facing feature or behavior changes are noted. These maintenance updates are also recorded in the Unreleased changelog.

brendan-kellam and others added 2 commits October 8, 2026 18:08
Neither has a patched release within the ranges requested upstream
(mermaid pins katex ^0.16, tailwindcss 3 pins postcss-selector-parser ^6),
so these use qualified resolutions overrides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0afe2b2c-9ba4-40cf-855f-8114b1fbd1cc

📥 Commits

Reviewing files that changed from the base of the PR and between c4dc556 and f3d2020.


⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

📒 Files selected for processing (1)
  • CHANGELOG.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 23e3bab7-a909-4db8-92ed-0389dac8e941

📥 Commits

Reviewing files that changed from the base of the PR and between 07797ba and c4dc556.


⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

📒 Files selected for processing (1)
  • CHANGELOG.md

🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.



Walkthrough

The root Yarn resolutions now direct specified postcss-selector-parser and katex requests to newer versions. The Unreleased changelog records these upgrades.

Changes

Dependency resolutions

Layer / File(s) Summary
Update dependency resolution targets
package.json, CHANGELOG.md
The resolutions map directs specified postcss-selector-parser requests to ^7.1.6 and katex@^0.16.45 requests to ^0.18.2. The Unreleased changelog records both upgrades.

Priority: ⬆️ High

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to c4dc5

The dependency upgrades resolve to patched versions, and no outstanding issue was identified. The PR is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the dependency upgrades and their security purpose. It matches the main changes in the pull request.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

License Audit

⚠️ Status: PASS

Metric Count
Total packages 2181
Resolved (non-standard) 9
Unresolved 0
Strong copyleft 0
Weak copyleft 28

Weak Copyleft Packages (informational)

Package Version License
@img/sharp-libvips-darwin-arm64 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-darwin-x64 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-arm 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-arm64 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-ppc64 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-riscv64 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-s390x 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-linuxmusl-arm64 1.3.4 LGPL-3.0-or-later
@img/sharp-libvips-linuxmusl-x64 1.3.4 LGPL-3.0-or-later
@img/sharp-wasm32 0.35.5 Apache-2.0 AND LGPL-3.0-or-later AND MIT
@img/sharp-win32-arm64 0.35.5 Apache-2.0 AND LGPL-3.0-or-later
@img/sharp-win32-ia32 0.35.5 Apache-2.0 AND LGPL-3.0-or-later
@img/sharp-win32-x64 0.35.5 Apache-2.0 AND LGPL-3.0-or-later
axe-core 4.10.3 MPL-2.0
dompurify 3.4.16 (MPL-2.0 OR Apache-2.0)
lightningcss 1.32.0 MPL-2.0
lightningcss-android-arm64 1.32.0 MPL-2.0
lightningcss-darwin-arm64 1.32.0 MPL-2.0
lightningcss-darwin-x64 1.32.0 MPL-2.0
lightningcss-freebsd-x64 1.32.0 MPL-2.0
lightningcss-linux-arm-gnueabihf 1.32.0 MPL-2.0
lightningcss-linux-arm64-gnu 1.32.0 MPL-2.0
lightningcss-linux-arm64-musl 1.32.0 MPL-2.0
lightningcss-linux-x64-gnu 1.32.0 MPL-2.0
lightningcss-linux-x64-musl 1.32.0 MPL-2.0
lightningcss-win32-arm64-msvc 1.32.0 MPL-2.0
lightningcss-win32-x64-msvc 1.32.0 MPL-2.0
Resolved Packages (9)
Package Version Original Resolved Source
@aws-sdk/core 3.974.5 UNKNOWN Apache-2.0 package.json in installed node_modules/@aws-sdk/core (original lookup failed with 'fetch failed'); LICENSE file is Apache 2.0
codemirror-lang-elixir 4.0.0 UNKNOWN Apache-2.0 GitHub repo LICENSE file (livebook-dev/codemirror-lang-elixir), verified from installed package LICENSE
khroma 2.1.0 UNKNOWN MIT GitHub repo license file (fabiospampinato/khroma), verified from installed package license file
lezer-elixir 1.1.2 UNKNOWN Apache-2.0 GitHub repo LICENSE file (livebook-dev/lezer-elixir), verified from installed package LICENSE
map-stream 0.1.0 UNKNOWN MIT GitHub repo LICENCE file (dominictarr/map-stream), verified from installed package LICENCE (MIT text)
memorystream 0.3.1 UNKNOWN MIT extracted from object (package.json 'licenses': [{type: 'MIT', url: ...}]); LICENSE file is MIT text
pause-stream 0.0.11 ["MIT", "Apache2"] (MIT OR Apache-2.0) extracted from array ['MIT','Apache2']; LICENSE file states 'Dual Licensed MIT and Apache 2'
posthog-js 1.369.0 SEE LICENSE IN LICENSE Apache-2.0 GitHub repo LICENSE file (PostHog/posthog-js), verified from installed package LICENSE (Apache License 2.0)
valid-url 1.0.9 UNKNOWN MIT GitHub repo LICENSE file (ogt/valid-url), verified from installed package LICENSE (MIT text)

@brendan-kellam
brendan-kellam merged commit e291d78 into main Oct 9, 2026
19 of 20 checks passed
@brendan-kellam
brendan-kellam deleted the brendan/cve-katex-postcss-selector-parser branch October 9, 2026 14:59
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