Описание
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. From 0.11.0 until 0.18.2, KaTeX uses ordinary JavaScript property access for the renderer options object, the trust setting, default and processor setting metadata, and namespace lookup and group restoration, allowing inherited properties to be treated as explicitly supplied values. When Object.prototype is already polluted or an attacker controls the options object's prototype, attacker-controlled mathematical expressions can use an inherited trust value to enable trusted rendering and produce links capable of user-interaction cross-site scripting or loading attacker-selected external resources in a consuming application that inserts unsanitized KaTeX output into a page. KaTeX does not itself create the prototype pollution, and rendering an expression alone does not execute script. This issue is fixed in version 0.18.2.
A flaw was found in KaTeX. When JavaScript prototype pollution is present or an attacker can manipulate configuration prototypes, KaTeX improperly relies on inherited properties instead of strictly validated configuration options. A remote attacker submitting crafted mathematical expressions can exploit this behavior to bypass trust restrictions, leading to cross-site scripting (XSS) or the loading of unauthorized external resources in web applications that display unsanitized output.
Отчет
A flaw of moderate impact was found in KaTeX, a JavaScript library for rendering TeX math in web pages that is bundled in Red Hat products including Red Hat OpenShift AI, Red Hat OpenShift Dev Spaces, and Red Hat Build of Podman Desktop, as well as in Fedora and EPEL community packages. KaTeX uses ordinary JavaScript property access for renderer options, the trust setting, default and processor setting metadata, and namespace lookup and group restoration, allowing inherited properties to be treated as explicitly supplied values. When Object.prototype is already polluted or an attacker controls the prototype of the renderer options object, a remote attacker submitting crafted mathematical expressions can use an inherited trust value to enable trusted rendering and produce links capable of user-interaction cross-site scripting or loading of attacker-selected external resources in a consuming application that inserts unsanitized KaTeX output into a page. KaTeX does not itself create the prototype pollution: exploitation requires a separate prototype-pollution flaw or attacker control of the options object's prototype, rendering an expression alone does not execute script, and user interaction is required. Red Hat rates this flaw MODERATE with a CVSS 3.1 score of 4.7, while the upstream record assigns a CVSS 4.0 score of 2.1 (LOW); the difference stems from the different CVSS versions used and their assessment of the required attack prerequisites and user interaction. For the affected Red Hat OpenShift AI, Red Hat OpenShift Dev Spaces, and Red Hat Build of Podman Desktop components the fix is deferred because the severity is MODERATE with a CVSS score below 7.0 and no trackers are filed for such flaws; the residual risk is limited to cross-site scripting or external resource loading through user interaction in deployments that also contain a prototype-pollution flaw or attacker-controlled renderer options and that render untrusted input without sanitization. The Fedora and EPEL community affects are delegated, with the impact described above and the fix pursued by the respective community maintainers. The Red Hat Hardened Images stream is delegated with a not-affected determination because the component is not present in that product.
Меры по смягчению последствий
Upstream fixed this issue in KaTeX 0.18.2, so upgrading bundled katex packages to a version that includes this fix resolves the vulnerability. Until an update can be applied, the workarounds published in the upstream advisory reduce the risk: address any prototype-pollution vulnerability in the application or its dependencies; do not allow untrusted input to control the renderer options object or its prototype; sanitize KaTeX-generated HTML before inserting it into a document; and, as a targeted measure, delete Object.prototype.trust, Object.prototype.default, and Object.prototype.processor before calling KaTeX.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Red Hat Build of Podman Desktop | rh-podman-desktop | Fix deferred | ||
| Red Hat Hardened Images | openshell | Not affected | ||
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9 | Fix deferred | ||
| Red Hat OpenShift Dev Spaces | devspaces/code-rhel9 | Fix deferred |
Показывать по
Ссылки на источники
Дополнительная информация
Статус:
EPSS
4.7 Medium
CVSS3
Связанные уязвимости
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. From 0.11.0 until 0.18.2, KaTeX uses ordinary JavaScript property access for the renderer options object, the trust setting, default and processor setting metadata, and namespace lookup and group restoration, allowing inherited properties to be treated as explicitly supplied values. When Object.prototype is already polluted or an attacker controls the options object's prototype, attacker-controlled mathematical expressions can use an inherited trust value to enable trusted rendering and produce links capable of user-interaction cross-site scripting or loading attacker-selected external resources in a consuming application that inserts unsanitized KaTeX output into a page. KaTeX does not itself create the prototype pollution, and rendering an expression alone does not execute script. This issue is fixed in version 0.18.2.
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. From 0.11.0 until 0.18.2, KaTeX uses ordinary JavaScript property access for the renderer options object, the trust setting, default and processor setting metadata, and namespace lookup and group restoration, allowing inherited properties to be treated as explicitly supplied values. When Object.prototype is already polluted or an attacker controls the options object's prototype, attacker-controlled mathematical expressions can use an inherited trust value to enable trusted rendering and produce links capable of user-interaction cross-site scripting or loading attacker-selected external resources in a consuming application that inserts unsanitized KaTeX output into a page. KaTeX does not itself create the prototype pollution, and rendering an expression alone does not execute script. This issue is fixed in version 0.18.2.
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering ...
KaTeX: Existing prototype pollution can bypass trust restrictions
EPSS
4.7 Medium
CVSS3