🇰🇷 한글 설명
rails-html-sanitizer 라이브러리에서 SVG 요소의 href 속성을 검사할 때 xlink:href만 제한하고 일반 href 속성은 제한하지 않는 취약점이 발견되었습니다. 이로 인해 공격자가 외부 SVG를 참조하여 스크립트를 실행하거나 외부 이미지를 로드하여 사용자를 추적할 수 있습니다. 이 문제는 1.7.1 버전에서 수정되었습니다.
💡 쉬운 설명
웹사이트에서 HTML 코드를 깨끗하게 청소해주는 도구가 특정 방식의 링크를 제대로 걸러내지 못하는 문제입니다. 이를 통해 해커가 몰래 악성 코드를 실행하거나 사용자의 정보를 몰래 빼낼 수 있습니다.
🇺🇸 원문 (English)
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. From 1.0.3 until 1.7.1, Rails::HTML::PermitScrubber restricted SVG reference elements in SVG_ALLOW_LOCAL_HREF only when they used xlink:href, even though browsers also accept the plain href attribute. Applications with non-default allowed tags that included SVG use or feImage elements could therefore permit external references; a same-origin external SVG referenced by use could execute scripts in the sanitized document's context, while feImage could load external images for tracking. Applications using the default allowed tags are not affected. This issue is fixed in version 1.7.1.
📍 영향받는 시스템
rails-html-sanitizer 1.0.3 ~ 1.7.0
⚔️ 공격 벡터
SVG 요소 내의 일반 href 속성을 이용한 외부 리소스 참조 및 스크립트 실행
🛡️ 대응 방법
rails-html-sanitizer 라이브러리를 1.7.1 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 1.7.1 미만인지 확인하십시오.
gem list rails-html-sanitizer