GHSA-cg87-wmx4-v546

Suggest an improvement
Source
https://github.com/advisories/GHSA-cg87-wmx4-v546
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/01/GHSA-cg87-wmx4-v546/GHSA-cg87-wmx4-v546.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-cg87-wmx4-v546
Aliases
  • CVE-2025-23207
Published
2025-01-17T21:22:56Z
Modified
2025-01-17T21:42:11.781189Z
Severity
  • 6.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L CVSS Calculator
Summary
KaTeX \htmlData does not validate attribute names
Details

Impact

KaTeX users who render untrusted mathematical expressions with renderToString could encounter malicious input using \htmlData that runs arbitrary JavaScript, or generate invalid HTML.

Patches

Upgrade to KaTeX v0.16.21 to remove this vulnerability.

Workarounds

  • Avoid use of or turn off the trust option, or set it to forbid \htmlData commands.
  • Forbid inputs containing the substring "\\htmlData".
  • Sanitize HTML output from KaTeX.

Details

\htmlData did not validate its attribute name argument, allowing it to generate invalid or malicious HTML that runs scripts.

For more information

If you have any questions or comments about this advisory:

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-116"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2025-01-17T21:22:56Z"
}
References

Affected packages

npm / katex

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.12.0
Fixed
0.16.21

Database specific

{
    "last_known_affected_version_range": "<= 0.16.20"
}