Skip to content

fix(deps): update dependency katex to v0.18.2 [security] - #4422

Merged
yannickmonney merged 2 commits into
mainfrom
renovate/npm-katex-vulnerability
Oct 7, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
renovate/npm-katex-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
katex (source) 0.16.47 → 0.18.2 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


KaTeX: Existing prototype pollution can bypass trust restrictions

CVE-2026-103923 / GHSA-238p-pmpm-9mq7

More information

Details

Impact

KaTeX can act as a read-side prototype pollution gadget in applications where Object.prototype has already been polluted, or where an attacker can influence the prototype of the renderer options object. (KaTeX does not enable said prototype pollution. This advisory applies when combining KaTeX with other vulnerable software that allows for prototype pollution.)

Affected versions may treat inherited properties from Object.prototype as renderer options, internal setting metadata, or namespace entries. In particular, an inherited trust value will be treated as though the application explicitly enabled trusted rendering, rather than using the documented default of false.

With attacker-controlled mathematical expressions, this can produce links capable of user-interaction cross-site scripting or load attacker-selected external resources. Exploitation requires the consuming application to insert KaTeX output into a web page without a separate sanitizer. (KaTeX does not execute scripts merely by rendering an expression.)

Other inherited settings can alter rendering behavior or resource limits. Inherited setting metadata can affect how defaults and supplied options are processed, while inherited namespace properties can be mistaken for defined macros or other internal values.

Patches

Upgrade to KaTeX v0.18.2 to remove this vulnerability.

Workarounds
  • Address any prototype-pollution vulnerability in the application or its dependencies.
  • delete Object.prototype.trust, delete Object.prototype.default, and delete Object.prototype.processor before calling KaTeX
  • Do not allow untrusted input to control the renderer options object or its prototype.
  • Sanitize KaTeX-generated HTML before inserting it into a document.
Details

KaTeX previously used ordinary JavaScript property access in the following contexts:

  • Renderer settings could be inherited from the prototype of the options object.
  • Internal default and processor setting metadata could be inherited from Object.prototype.
  • Namespace lookup could treat inherited properties as built-in definitions.
  • Namespace group restoration could preserve an inherited property as though it had been an explicitly defined value.

The fix adds own-property checks to each of these paths. Inherited properties are no longer accepted as renderer settings, setting metadata, namespace definitions, or values to be restored after a group ends.

For more information

If you have any questions or comments about this advisory:

Severity

  • CVSS Score: 2.1 / 10 (Low)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

KaTeX/KaTeX (katex)

v0.18.2

Compare Source

Bug Fixes

v0.18.1

Compare Source

Features

v0.18.0

Compare Source

Features
BREAKING CHANGES
  • users who apply custom styles or have allowlists targeting KaTeX's internal classes must update their selectors.

v0.17.0

Compare Source

Performance Improvements
  • simplify defineFunction to avoid destructuring, improve typing (#​4222) (fb604e6)
BREAKING CHANGES
  • The internal API for __defineFunction changed: you should no longer wrap properties in props.

0.16.47 (2026-05-16)

Bug Fixes

0.16.46 (2026-05-13)

Bug Fixes

0.16.45 (2026-04-05)

Bug Fixes

0.16.44 (2026-03-27)

Bug Fixes
  • remove extra \jot space at bottom of align/gather/etc. (#​4184) (3870ee9)

0.16.43 (2026-03-26)

Bug Fixes
  • use makeEm() consistently to truncate long CSS decimals (#​4181) (0967dcc)

0.16.42 (2026-03-24)

Features

0.16.41 (2026-03-24)

Bug Fixes

0.16.40 (2026-03-20)

Bug Fixes

0.16.39 (2026-03-19)

Bug Fixes

0.16.38 (2026-03-08)

Bug Fixes

0.16.37 (2026-03-06)

Bug Fixes

0.16.36 (2026-03-06)

Bug Fixes

0.16.35 (2026-03-05)

Bug Fixes

0.16.34 (2026-03-05)

Bug Fixes

0.16.33 (2026-02-23)

Bug Fixes

0.16.32 (2026-02-22)

Bug Fixes

0.16.31 (2026-02-22)

Bug Fixes

0.16.30 (2026-02-22)

Bug Fixes

0.16.29 (2026-02-22)

Bug Fixes

0.16.28 (2026-01-25)

Bug Fixes
  • type: add missing types definition path to package.json (#​4125) (0ef8921)

0.16.27 (2025-12-07)

Features
  • support equals sign and surrounding whitespace in \htmlData attribute values (#​4112) (c77aaec)

0.16.26 (2025-12-07)

Bug Fixes
  • \mathop followed by integral symbol (6fbad18)

0.16.25 (2025-10-13)

Features

0.16.24 (2025-10-12)

Features

0.16.23 (2025-10-03)

Bug Fixes

0.16.22 (2025-04-09)

Bug Fixes

0.16.21 (2025-01-17)

Bug Fixes
  • escape \htmlData attribute name (57914ad)

0.16.20 (2025-01-12)

Bug Fixes

0.16.19 (2024-12-29)

Bug Fixes

0.16.18 (2024-12-18)

Bug Fixes

0.16.17 (2024-12-17)

Bug Fixes
  • MathML combines multidigit numbers with sup/subscript, comma separators, and multicharacter text when outputting to DOM (#​3999) (7d79e22), closes #​3995

0.16.16 (2024-12-17)

Features

0.16.15 (2024-12-09)

Features
  • italic sans-serif in math mode via \mathsfit command (#​3998) (2218901)

0.16.14 (2024-12-08)

Features

0.16.13 (2024-12-08)

Bug Fixes

0.16.12 (2024-12-08)

Features

0.16.11 (2024-07-02)

Features

0.16.10 (2024-03-24)

Bug Fixes

0.16.9 (2023-10-02)

Features

0.16.8 (2023-06-24)

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

0.16.7 (2023-04-28)

Bug Fixes

0.16.6 (2023-04-17)

Bug Fixes

0.16.5 (2023-04-17)

Features

0.16.4 (2022-12-07)

Bug Fixes

0.16.3 (2022-10-22)

Bug Fixes

0.16.2 (2022-08-29)

Bug Fixes

0.16.1 (2022-08-28)

Bug Fixes

Configuration

📅 Schedule: (in timezone Europe/Zurich)

  • Branch creation
    • At any time (no schedule defined)
  • 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 these updates again.


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

This PR was generated by Mend Renovate. View the repository job log.

@yannickmonney

Copy link
Copy Markdown
Contributor

Independent exact-head review — REQUEST CHANGES

Reviewed PR #4422 at head 86a0a3f4194b8c351baa4100ef0a86394f164bf4 (unchanged on re-read). GitHub reports mergeable but UNSTABLE; no lockfile conflict is present now.

Topic Judgment Evidence
SECURITY ACCEPT for KaTeX remediation GHSA-238p-pmpm-9mq7 / CVE-2026-103923 affects >=0.11.0 <0.18.2, fixed in 0.18.2, CVSS 2.1 Low. The lockfile has one direct [email protected] record and no older KaTeX package record; transitive ranges from mermaid, micromark-extension-math, and rehype-katex resolve to that same record.
CODE / compatibility ACCEPT with browser evidence owed Consumers are rehype-katex in packages/ui/src/markdown/markdown.tsx and lazy streaming, plus katex/dist/katex.min.css; calls use renderToString with displayMode, throwOnError, fallback strict: 'ignore'. No Tale use of trust, output, macros, or __defineFunction. Changelog: 0.18.0 prefixes internal CSS classes; 0.17.0 changes only the internal API; 0.18.1 fixes escaped htmlData commas; 0.18.2 fixes inherited-property handling. No custom internal-class selectors were found.
CICD REQUEST CHANGES Exact-head CI checked out merge ref 5fcedf1 (merge of 86a0a3f into a2dbe4c). CI ready (Checks) and Unit/workspace aggregate are red; concrete Unit failure: docs-layout.test.tsx cannot find role dialog. CI ready (Security)/Bun audit are red on unrelated high/critical advisories. Build, UI, E2E, SAST, typecheck, lint, format, integration, and performance passed.
PERFORMANCE NOT_APPLICABLE npm unpacked size: 4,037,040 (0.16.47) → 4,032,120 bytes (0.18.2), −4,920 (−0.12%); no bundle measurement is admitted.
Part A (visible math rendering) BLOCKED Browser stack required. Owed: inline/display render comparison, streaming/lazy load, fonts, and custom selectors.
Other topics NOT_APPLICABLE No source behavior, schema, deployment, migration, or runtime configuration changes.

Disposition: request changes for failing exact-head CI and owed browser evidence; the advisory/version and lockfile resolution are correct.

@yannickmonney

Copy link
Copy Markdown
Contributor

TALE-1050 — single security PR refresh

The single authorized update-branch call used expected head 86a0a3f4194b8c351baa4100ef0a86394f164bf4 and succeeded. New head: cdd31653dacb21f88503f5436729d36fb0c6b9ca; updated main base: 5b6ab36bb3ed00bed28bb9f4e79d082c3f1144b0. No source edits, pushes, reruns or merges.

Exact-head CI — one bounded read

Run list read at 2026-10-07 01:36:25 UTC, followed by one jobs read per run. These are observations from that snapshot, not final verdicts.

Run Workflow Run head SHA Observed status
37557817993 SAST cdd31653dacb21f88503f5436729d36fb0c6b9ca in_progress; pending
37557817908 Security cdd31653dacb21f88503f5436729d36fb0c6b9ca queued; pending
37557817997 Build cdd31653dacb21f88503f5436729d36fb0c6b9ca queued; pending
37557818095 Checks cdd31653dacb21f88503f5436729d36fb0c6b9ca in_progress; pending
37557818116 Commitlint cdd31653dacb21f88503f5436729d36fb0c6b9ca in_progress; pending
37557818048 E2E cdd31653dacb21f88503f5436729d36fb0c6b9ca queued; pending
37557817780 CLI cdd31653dacb21f88503f5436729d36fb0c6b9ca queued; pending

Bun audit PASS (job 112588102121, Security run 37557817908), so the previous audit blocker is absent in this snapshot. Format, Lint, Knip, Performance and Lint commits also reported success. Unit (workspaces), both platform Unit shards, all four UI shards, Browser, Type check, integration and the Checks build job were still in progress. No jobs had a failure/timed-out conclusion in the single jobs reads, so there were no failing-job FAIL or ##[error] lines to attribute. The previous docs-layout.test.tsx failure is neither reproduced nor cleared by this pending result. All seven workflow conclusions remain pending; CI acceptance is BLOCKED/pending.

Static CODE evidence at the new tree

Enumerated the complete, non-truncated Git tree and checked all 23 CSS, 0 SCSS and 2,105 TSX files, including packages/ui, against their exact blob hashes. Also inspected test/config and markdown TypeScript sources. KaTeX searches found no custom CSS/SCSS selectors targeting KaTeX. In TSX, the actual KaTeX selectors are the assertions in packages/ui/src/markdown/markdown.test.tsx: .katex and .katex-display; these wrapper classes remain unchanged.

Checked the 0.18.0 prefixing patch for the old internal names (including .base, .strut, .sizing, .tag, .root, .inner, .fix, .accent, .overlay, .stretchy, .rule, .hline, .hdashline, .smash, .sout, .thinbox, .vbox, .overline, .underline, .newline). No Tale selector was found targeting these KaTeX internals. Generic matches such as typography size base, variant underline, toolbar position overlay, and DOM id root are unrelated props/identifiers, not KaTeX selectors.

Both regular and lazy streaming renderers import katex/dist/katex.min.css from the resolved dependency. Streaming appends rehype-katex after sanitization; generated KaTeX class names do not depend on a pre-render sanitizer allowlist. Lockfile still has a single KaTeX package record at 0.18.2, with the root override/direct UI dependency at that version.

Checked KaTeX v0.18.2 changelog: 0.17.0 changes internal __defineFunction; Tale's markdown consumers do not use it. 0.18.0 changes internal class selectors as checked above. 0.18.1 fixes escaped commas in htmlData; 0.18.2 fixes settings prototype pollution. Tale uses rehype-katex 7.0.1 without custom options: its published implementation calls renderToString with inferred displayMode, first throwOnError: true, then fallback strict: 'ignore' and throwOnError: false. No changelog entry removes/renames these public API/options. Static compatibility gap closed; this is not visual evidence.

Browser/UI evidence and remaining blockers

packages/ui/src/markdown/markdown.test.tsx covers inline math, display math with MathML annotation, streaming through sanitization and math arriving mid-stream. packages/ui/vitest.config.ts assigns it to the jsdom unit project, run by Unit (workspaces) (job 112588008364, Checks run 37557818095); it was pending, not observed PASS. The separate real-Chromium *.browser.test.tsx project and E2E/Storybook source searches did not identify a dedicated KaTeX-output visual test. Browser job 112588008504 and Storybook job 112588112196 were still pending; their eventual overall result alone would not prove a math visual comparison.

Real visual rendering: BLOCKED. No browser stack was started; worker sandboxes lack the pinned Chromium. Inline/display appearance, fonts and streaming/lazy rendering still require an admitted browser review. C13/Fleet should read the listed runs at their next CI checkpoint and arrange the visual proof; no automatic polling or rerun is scheduled by this task.

@renovate

renovate Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@yannickmonney

Copy link
Copy Markdown
Contributor

TALE-1053 — independent re-review: ACCEPT

Reviewed head cdd31653dacb21f88503f5436729d36fb0c6b9ca, re-read before publication. This supersedes the dispositions in review 6014473366 for this head.

Point New disposition Evidence / closure
SECURITY ACCEPT — retained GHSA-238p-pmpm-9mq7 is Low (CVSS 2.1), fixed in 0.18.2. The complete dependency-only diff changes three files: root override, UI dependency and bun.lock. One runtime KaTeX record resolves to 0.18.2; Mermaid, micromark-extension-math, rehype-katex and Milkdown ranges share that override. @types/[email protected] is a type package, not an older runtime. Bun audit succeeded.
CICD ACCEPT — previous REQUEST CHANGES closed All seven exact-head workflows and their CI-ready aggregators succeeded: Checks, Commitlint, SAST, Security, CLI, E2E and Build. Native check snapshot: 72 success, 17 skipped, 1 neutral, no failure/pending. Unit aggregate, both platform shards and Unit (workspaces) passed; Bun audit passed. Skipped candidate/release/fork-only jobs are inapplicable for this PR; advisory Trivy neutral is not a claim of zero vulnerabilities.
CODE / compatibility ACCEPT — retained; static gap closed Independently grepped the exact-head tree, including all 23 CSS, 0 SCSS and 2,105 TSX files, KaTeX references, browser/E2E spec sources and old internal-class names. No custom selectors targeting KaTeX internals found. Generic .rule/.base matches are object properties; reveal.js styling is unrelated. Actual KaTeX selectors are unit assertions for unchanged .katex/.katex-display wrappers. Both regular and lazy renderers import dependency-owned katex/dist/katex.min.css; streaming adds KaTeX after sanitization. No Tale use of the changed internal __defineFunction API identified. This corroborates C13's static findings.
Part A — visible math rendering BLOCKED — kept; never PASS No dedicated real-browser/UI test rendering KaTeX output was identified in the inspected sources. Browser/UI/E2E green results do not establish math appearance or a visual comparison; Storybook's job builds the site. Existing inline/display, MathML and streaming/lazy-load assertions are jsdom unit tests. CI artifact proves markdown.test.tsx 5/5 passed, and the formerly failing docs-layout.test.tsx 5/5 passed. @tale/ui#test was cache MISS, exit 0; 299 files / 2,966 tests passed. Inline/display appearance, fonts and streaming visual comparison remain owed; no local browser stack was admitted or started.
PERFORMANCE NOT_APPLICABLE — retained No performance-sensitive application code changes. No new bundle measurement or benchmark was run.
Other topics NOT_APPLICABLE — retained No application source, schema, migration, deployment or runtime configuration changes in the PR diff.

Execution evidence: Checks run 37557818095, Unit (workspaces) job 112588008364, Turbo/unit artifact 11455168435. CI checked out merge SHA cf1930eaf018c8b335a9702b6fac434a617b4ab1, explicitly merging this head into 5b6ab36bb3ed00bed28bb9f4e79d082c3f1144b0; the Turbo summary records that merge SHA, not a different PR head.

Decision: the remaining visual BLOCKED is acceptable for this Low-severity security bump: fresh functional math assertions passed, dependency CSS follows the same resolved version as its renderer, and the internal-class breaking change has no identified custom-selector coupling. This is a risk acceptance of the missing visual comparison, not evidence that appearance passed. The previous CI blocker is resolved and the remaining browser evidence is explicitly outstanding rather than a merge-blocking request for this head.

Handoff: Fleet routes merge consideration to #2. Main currently reads a89498df49b8ea957c14e14ca878943e98fa6849 (seven newer main commits); #2 must assess freshness at merge time. This acceptance applies only to the reviewed head. No merge, push, branch update, install, build or local test execution performed.

@yannickmonney

Copy link
Copy Markdown
Contributor

Merge-lane coverage dispositions at cdd31653dacb21f88503f5436729d36fb0c6b9ca. From agent #2 (TALE-359 run 557c5b0f), the merger.

Topic Disposition Basis
SECURITY PASS C14: GHSA-238p-pmpm-9mq7 (Low) is fixed in katex 0.18.2. One runtime KaTeX resolves to 0.18.2, and Mermaid, micromark-extension-math, rehype-katex and Milkdown share the override. Bun audit succeeded.
CODE PASS A dependency-only diff: root override, packages/ui dependency and bun.lock. C14 found no custom selectors on KaTeX internals and no use of the changed internal API. Both renderers import the dependency-owned katex.min.css.
UI-RESPONSIVE, UX-CLARITY (visible math rendering) BLOCKED, residual risk accepted There is no real-browser or visual comparison of KaTeX output. jsdom math assertions passed: markdown.test.tsx 5/5 and @tale/ui#test with a cache MISS (299 files, 2,966 tests). C14 accepted the visual gap as a risk for this Low-severity security bump. Fleet coordination listed this PR merge-ready with that cell BLOCKED (TALE-359 1945b5b9, 963790ec). It is not reported as PASS.
A11Y NOT_RUN MathML output is covered only by the existing jsdom assertions; there is no assistive-technology run.
REL-MANUAL PASS (functional, jsdom) The formerly failing docs-layout.test.tsx passes 5/5 and the math rendering tests pass at this head.
PERFORMANCE NOT_APPLICABLE No application code change; no bundle measurement was taken.
CICD PASS; tested base STALE 90 checks: 72 success, 17 by-design skips, 1 neutral; Backend integration ran. CI tested merge cf1930ea (this head on 5b6ab36b). Main's seven commits since then touch no package.json, bun.lock or KaTeX consumer, and the patch-id is identical on current main.
UX-SIMPLICITY, LOCALE, DOCS, DATA, RESOURCES, DEPLOYMENT, RECOVERY, PROVIDERS, OBSERVABILITY, WORKFLOW NOT_APPLICABLE A dependency version bump with no workflow, string, schema or configuration change. Images rebuild with the new lockfile.

Merge-gate dry run at 04:53:49Z: open, CLEAN, head matches; no required contexts. checks total=90 not-completed=0 failing=0 [neutral=1 skipped=17 success=72] neutral=[Trivy[github-advanced-security]] statuses=[pending total=0]. Every skip is on the by-design allowlist skip-allow-1545-bi.txt; no check is pending or failing. Merging next with --squash --match-head-commit cdd31653dacb21f88503f5436729d36fb0c6b9ca.

@yannickmonney
yannickmonney merged commit bcd061a into main Oct 7, 2026
@yannickmonney
yannickmonney deleted the renovate/npm-katex-vulnerability branch October 7, 2026 04:54
yannickmonney added a commit that referenced this pull request Oct 7, 2026
Cover all ten merges after a89498d through e011cc8: #4464, #4422,
#4468, #4470, #4457, #4465, #4472, #4469 and #4474, plus test-only
#4473. Apply C3's cumulative upgrade path from v0.5.74 and pin its
v0.5.75 notes link to the v0.5.75 tag. Drop the #4438, #4466 and #4440
known issues, now fixed, and list the Environment docs drift (#4454).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant