🔍 CVE-2023-51652

6.1
CVSS Score
MEDIUM
2024-01-02
2026-06-17 06:41
✅ 완료

🇰🇷 한글 설명

OWASP AntiSamy .NET 라이브러리 1.2.0 미만 버전에서 HTML 파싱 오류로 인해 발생하는 변이형 교차 사이트 스크립팅(mXSS) 취약점입니다. 정책 파일에서 preserveComments 설정이 활성화되어 있고 특정 태그가 허용될 경우, 주석 태그 내의 요소가 실행 가능한 코드로 해석될 수 있습니다.

💡 쉬운 설명

웹사이트에서 위험한 코드를 걸러내는 도구가 특정 조건에서 주석 속에 숨겨진 악성 코드를 제대로 찾아내지 못하는 문제입니다. 공격자는 이를 이용해 사용자의 브라우저에서 몰래 악성 스크립트를 실행할 수 있습니다.

🇺🇸 원문 (English)

OWASP AntiSamy .NET is a library for performing cleansing of HTML coming from untrusted sources. Prior to version 1.2.0, there is a potential for a mutation cross-site scripting (mXSS) vulnerability in AntiSamy caused by flawed parsing of the HTML being sanitized. To be subject to this vulnerability the `preserveComments` directive must be enabled in your policy file and also allow for certain tags at the same time. As a result, certain crafty inputs can result in elements in comment tags being interpreted as executable when using AntiSamy's sanitized output. This is patched in OWASP AntiSamy .NET 1.2.0 and later. See important remediation details in the reference given below. As a workaround, manually edit the AntiSamy policy file (e.g., antisamy.xml) by deleting the `preserveComments` directive or setting its value to `false`, if present. Also it would be useful to make AntiSamy remove the `noscript` tag by adding a line described in the GitHub Security Advisory to the tag definitions under the `<tagrules>` node, or deleting it entirely if present. As the previously mentioned policy settings are preconditions for the mXSS attack to work, changing them as recommended should be sufficient to protect you against this vulnerability when using a vulnerable version of this library. However, the existing bug would still be present in AntiSamy or its parser dependency (HtmlAgilityPack). The safety of this workaround relies on configurations that may change in the future and don't address the root cause of the vulnerability. As such, it is strongly recommended to upgrade to a fixed version of AntiSamy.

📍 영향받는 시스템

OWASP AntiSamy .NET 1.2.0 미만 버전

⚔️ 공격 벡터

특수하게 조작된 HTML 입력을 통해 주석 태그 내의 코드가 실행되도록 유도하는 mXSS 공격

🛡️ 대응 방법

OWASP AntiSamy .NET을 1.2.0 이상 버전으로 업그레이드하거나, 정책 파일에서 preserveComments 설정을 false로 변경합니다.

🔧 검증 코드

출력된 AntiSamy의 버전이 1.2.0 미만인지 확인합니다.

Shell / Script
dotnet list package | grep AntiSamy

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

.NET