---
id: CVE-2026-5389
title: >-
  justhtml versions before 1.13.0 contain a cross-site scripting vulnerability
  in the to_markdown() function when serializing attacker-controlled pre content
summary: >-
  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 fixe…
severity: medium
cvss: 6.1
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'
cwe:
  - CWE-80
vendor: justhtml
product: justhtml
affected:
  - justhtml < 1.13.0
patched:
  - justhtml 1.13.0
published: '2026-08-23'
updated: '2026-10-12'
sourceUpdated: '2026-10-12T16:10:00.220'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-5389'
references:
  - url: >-
      https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-5vp3-3cg6-2rq3
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/justhtml-before-xss-via-code-fence-breakout
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-5vp3-3cg6-2rq3
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
  - url: >-
      https://github.com/EmilStenstrom/justhtml/commit/f35f8f723c713bd8f912d86e9ec6881275ff5af9
  - url: 'https://github.com/EmilStenstrom/justhtml'
  - url: 'https://github.com/EmilStenstrom/justhtml/releases/tag/v1.13.0'
tags:
  - nvd
  - osv
  - pip
epss: 0.0023
epssPercentile: 0.13737
aliases:
  - GHSA-5vp3-3cg6-2rq3
ecosystem: pip
ingestedAt: '2026-08-24T19:25:44.090Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-5389)

Affected packages:

- `justhtml < 1.13.0`

Patched in:

- `justhtml 1.13.0`

Source: https://osv.dev/vulnerability/GHSA-5vp3-3cg6-2rq3
