Kestrel
대시보드로 돌아가기
CVE-2026-59923MEDIUM· 6.1MITRENVDGHSA대응게시일: 2026. 07. 08.수정일: 2026. 07. 20.

Mistune: XSS via percent-encoded javascript URI bypass in safe_url()

XSS

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
6.1medium

이론적 심각도 점수

EPSS
0.2%상위 84.9%

30일 내 악용 확률 예측

KEV
미등재

실측 악용 기록 없음

권장 대응 기한60일 이내CISA SSVC 기준

계획된 패치 주기 내 조치(60일 이내)

외부 노출· KEV 미등재 · 자동화 어려움 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한불필요
사용자 상호작용필요
범위변경
영향
기밀성 영향낮음
무결성 영향낮음
가용성 영향없음
버전별 점수
CVSS 3.16.1MODERATE
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

상세 설명

Summary

An XSS vulnerability in Mistune allows bypassing of safe_url() protections via percent-encoded javascript URIs.

Details

The vulnerability exists in HTMLRenderer.safe_url() in Mistune.

The function is intended to block harmful URL schemes such as "javascript:" by checking the prefix of the provided URL:

bash
1_url = url.lower()
2if _url.startswith(self.HARMFUL_PROTOCOLS):
3 return "#harmful-link"

However, the input URL is not URL-decoded before this check. Because of this, an attacker can use percent-encoding to bypass the filter. For example:

xss
1javascript%3Aalert(1)

Since "%3A" is not decoded to ":", the check does not detect the "javascript:" scheme.

When rendered in a browser, the URL is decoded, resulting in execution of arbitrary JavaScript upon user interaction.

This effectively bypasses Mistune's built-in safe_url() protection mechanism.

PoC

  1. Install vulnerable version:

    pip install mistune==3.2.0

  2. Run the following code:

    import mistune

    markdown = mistune.create_markdown()
    html = markdown("j")

    print(html)

  3. Output:

    <p><a href="javascript%3Aalert(1)">j</a></p>
  4. Open the rendered HTML in a browser and click the link.

  5. The browser decodes "%3A" into ":" and executes:

    javascript:alert(1)

Impact

This is a cross-site scripting (XSS) vulnerability.

An attacker can craft a malicious Markdown link that executes JavaScript in the victim's browser when clicked.

Impact includes:

  • Session hijacking (e.g., cookie theft)
  • Execution of arbitrary JavaScript in the victim's context
  • Potential account takeover depending on the application

This affects any application that renders user-controlled Markdown using Mistune without additional URL sanitization.

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.