Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. justhtml
  4. ›
  5. GHSA-5vp3-3cg6-2rq3

GHSA-5vp3-3cg6-2rq3: JustHTML is vulnerable to XSS via code fence breakout in <pre> content

March 24, 2026

to_markdown() is vulnerable when serializing attacker-controlled <pre> content. The <pre> handler emits a fixed three-backtick fenced code block, but writes decoded text content into that fence without choosing a delimiter longer than any backtick run inside the content.

An attacker can place backticks and HTML-like text inside a sanitized <pre> element so that the generated Markdown closes the fence early and leaves raw HTML outside the code block. When that Markdown is rendered by a CommonMark/GFM-style renderer that allows raw HTML, the HTML executes.

This is a bypass of the v1.12.0 Markdown hardening. That fix escaped HTML-significant characters for regular text nodes, but <pre> uses a separate serialization path and does not apply the same protection.

References

  • github.com/EmilStenstrom/justhtml
  • github.com/EmilStenstrom/justhtml/commit/f35f8f723c713bd8f912d86e9ec6881275ff5af9
  • github.com/EmilStenstrom/justhtml/releases/tag/v1.13.0
  • github.com/EmilStenstrom/justhtml/security/advisories/GHSA-5vp3-3cg6-2rq3
  • github.com/advisories/GHSA-5vp3-3cg6-2rq3

Code Behaviors & Features

Detect and mitigate GHSA-5vp3-3cg6-2rq3 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.13.0

Fixed versions

  • 1.13.0

Solution

Upgrade to version 1.13.0 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
  • CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

Source file

pypi/justhtml/GHSA-5vp3-3cg6-2rq3.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:20:16 +0000.