Description
justhtml versions before 1.13.0 contain a cross-site scripting vulnerability in the to_markdown() function when serializing attacker-controlled pre content. Attackers can place backticks inside sanitized pre elements to break out of fixed-length code fences, allowing raw HTML to execute when the generated Markdown is rendered by CommonMark or GFM-style renderers.
Published: 2026-08-23
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Cross‑site scripting (XSS)
Action: Patch Now
AI Analysis

Impact

The vulnerability resides in the to_markdown() function of justhtml prior to version 1.13.0. When an attacker supplies content that contains a <pre> element with backticks, the function incorrectly handles the fixed‑length code fences, causing the generated Markdown to include raw HTML that later renders in CommonMark or GitHub‑Flavored‑Markdown renderers. This flaw allows an attacker to execute arbitrary scripts in the browser context of any page that renders the affected Markdown.

Affected Systems

Individuals or organizations using justhtml 1.12.9 or earlier are exposed. The product is a markdown renderer library for Go, commonly embedded in web applications that render user‑supplied content. No other vendors or product versions are listed as affected.

Risk and Exploitability

The CVSS score is 5.1, indicating a moderate severity. EPSS is not available, so current exploitation probability cannot be assessed from that metric. The vulnerability is not listed in CISA's KEV catalog. Exploitation would require that an attacker can provide controlled content that passes through the to_markdown() routine and is subsequently rendered by a CommonMark or GitHub‑Flavored‑Markdown parser. In many environments, this could be achieved with a user profile page, comment box, or any feature that renders Markdown. Because the flaw is client‑side, the impact is limited to the victim’s browser, but it can still be used for phishing or session hijacking. The attack surface is therefore moderate, and remediation is strongly recommended.

Generated by OpenCVE AI on August 23, 2026 at 15:07 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade justhtml to version 1.13.0 or newer, which removes the code fence parsing bug.
  • Validate or sanitize all user‑supplied Markdown content before calling to_markdown(), ensuring no <pre> elements with unnested backticks are processed.
  • Implement a Content‑Security‑Policy that restricts inline script execution on pages that display rendered Markdown, to mitigate potential XSS from legacy content.

Generated by OpenCVE AI on August 23, 2026 at 15:07 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 24 Aug 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Sun, 23 Aug 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Emilstenstrom
Emilstenstrom justhtml
Vendors & Products Emilstenstrom
Emilstenstrom justhtml

Sun, 23 Aug 2026 14:00:00 +0000

Type Values Removed Values Added
Description justhtml versions before 1.13.0 contain a cross-site scripting vulnerability in the to_markdown() function when serializing attacker-controlled pre content. Attackers can place backticks inside sanitized pre elements to break out of fixed-length code fences, allowing raw HTML to execute when the generated Markdown is rendered by CommonMark or GFM-style renderers.
Title justhtml before 1.13.0 XSS via code fence breakout
Weaknesses CWE-80
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}


Subscriptions

Emilstenstrom Justhtml
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-24T18:15:49.005Z

Reserved: 2026-04-01T21:14:36.435Z

Link: CVE-2026-5389

cve-icon Vulnrichment

Updated: 2026-08-24T18:15:39.895Z

cve-icon NVD

Status : Deferred

Published: 2026-08-23T14:16:53.647

Modified: 2026-08-26T17:10:53.700

Link: CVE-2026-5389

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-23T16:39:45Z

Weaknesses
  • CWE-80

    Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)