🔍 CVE-2025-46734

6.4
CVSS Score
MEDIUM
2025-05-05
2026-04-15 00:35
✅ 완료

🇰🇷 한글 설명

league/commonmark PHP 마크다운 파서의 Attributes 확장에서 발견된 XSS 취약점으로, 악의적인 사용자가 중괄호를 이용한 마크다운 문법으로 HTML 속성을 주입할 수 있습니다. 버전 2.7.0에서 'on'으로 시작하는 속성 차단, 속성 화이트리스트 지원, 그리고 allow_unsafe_links 설정 존중을 통해 해결되었습니다.

💡 쉬운 설명

마크다운을 HTML로 변환하는 PHP 라이브러리에서 악의적인 JavaScript 코드를 삽입할 수 있는 보안 문제입니다. 사용자가 작성한 마크다운 콘텐츠를 처리할 때 공격자가 숨겨진 JavaScript를 추가할 수 있다는 의미입니다.

🇺🇸 원문 (English)

league/commonmark is a PHP Markdown parser. A cross-site scripting (XSS) vulnerability in the Attributes extension of the league/commonmark library (versions 1.5.0 through 2.6.x) allows remote attackers to insert malicious JavaScript calls into HTML. The league/commonmark library provides configuration options such as `html_input: 'strip'` and `allow_unsafe_links: false` to mitigate cross-site scripting (XSS) attacks by stripping raw HTML and disallowing unsafe links. However, when the Attributes Extension is enabled, it introduces a way for users to inject arbitrary HTML attributes into elements via Markdown syntax using curly braces. Version 2.7.0 contains three changes to prevent this XSS attack vector: All attributes starting with `on` are considered unsafe and blocked by default; support for an explicit allowlist of allowed HTML attributes; and manually-added `href` and `src` attributes now respect the existing `allow_unsafe_links` configuration option. If upgrading is not feasible, please consider disabling the `AttributesExtension` for untrusted users and/or filtering the rendered HTML through a library like HTMLPurifier.

📍 영향받는 시스템

league/commonmark 1.5.0 ~ 2.6.x (Attributes Extension 활성화된 경우)

⚔️ 공격 벡터

마크다운 문법의 중괄호 {}를 이용해 onload, onclick 등 on*으로 시작하는 HTML 이벤트 속성을 주입

🛡️ 대응 방법

2.7.0 이상으로 업그레이드하거나, AttributesExtension 비활성화 및 HTMLPurifier를 통한 출력 필터링 적용

🔧 검증 코드

2.7.0 이상이면 안전함, 2.6.x 이하이면 즉시 업그레이드 필요

Shell / Script
composer show league/commonmark 2>/dev/null | grep -i version | grep -E '2\.[7-9]|[3-9]\.'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N

💻 영향받는 소프트웨어

PHP