🇰🇷 한글 설명
league/commonmark 라이브러리의 AttributesExtension에서 발생하는 XSS 취약점입니다. 속성 이름 앞에 U+000C(폼 피드) 바이트를 추가하면 필터링을 우회하여 이벤트 핸들러나 javascript: URI를 삽입할 수 있습니다. 이 취약점은 2.9.1 버전에서 수정되었습니다.
💡 쉬운 설명
마크다운을 HTML로 변환할 때 특수 문자를 이용해 보안 검사를 속이는 공격입니다. 공격자가 악성 스크립트를 심어 사용자의 브라우저에서 실행되게 만들 수 있습니다.
🇺🇸 원문 (English)
league/commonmark (thephpleague/commonmark) versions >= 2.7.0 and < 2.9.1 contain a cross-site scripting vulnerability in the AttributesExtension. Prefixing an attribute name with a single U+000C form feed byte (e.g. {\x0Conclick="alert(1)"}) bypasses the AttributesHelper::filterAttributes() 'on*' event-handler filter because PHP's trim() does not strip U+000C, causing the attribute to be written verbatim into the output where browsers parse it as a genuine event handler. The same prefix also defeats the allow_unsafe_links check, allowing javascript: URIs through href/src attributes even when allow_unsafe_links is false. Exploitation requires processing untrusted Markdown with the AttributesExtension enabled; the injected script executes when the rendered HTML is viewed. Fixed in 2.9.1.
📍 영향받는 시스템
league/commonmark versions >= 2.7.0 and < 2.9.1
⚔️ 공격 벡터
신뢰할 수 없는 마크다운 입력값에 U+000C 바이트가 포함된 속성을 삽입하여 필터링 우회
🛡️ 대응 방법
league/commonmark 라이브러리를 2.9.1 버전 이상으로 업데이트
🔧 검증 코드
출력된 버전이 2.7.0 이상 2.9.1 미만인지 확인
composer show league/commonmark | grep 'versions'