🇰🇷 한글 설명
Angular의 @angular/platform-server에서 사용하는 domino 라이브러리에 Unicode 인덱스 정렬 오류로 인한 XSS 취약점이 존재합니다. 이 오류로 인해 이모지와 같은 astral Unicode 문자가 포함된 경우 닫는 태그가 제대로 이스케이프되지 않아 서버 사이드 렌더링(SSR) 시 악성 스크립트가 실행될 수 있습니다. 해당 문제는 22.0.0-rc.2, 21.2.16, 20.3.24, 19.2.25 버전에서 수정되었습니다.
💡 쉬운 설명
이모지 같은 특수 문자를 사용할 때 프로그램이 글자 수를 잘못 계산하여 보안 장치를 무력화하는 문제입니다. 공격자가 이 점을 이용해 웹사이트에 몰래 악성 코드를 심어 실행할 수 있습니다.
🇺🇸 원문 (English)
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 22.0.0-rc.2, 21.2.16, 20.3.24, and 19.2.25, a Cross-Site Scripting (XSS) vulnerability exists in @angular/platform-server's DOM emulation dependency (domino) when serializing the content of raw-text elements (such as <script>, <style>, and <iframe>). domino supports escaping raw-text elements during serialization to prevent closing-tag breakout. However, a Unicode index alignment bug existed in this escaping logic. In JavaScript, string lengths and character indices are calculated based on UTF-16 code units (where astral characters—such as emojis—occupy 2 code units / 4 bytes). If the bound dynamic text contained astral Unicode characters before the closing tag (e.g. </script>, </style>, or </iframe>), the index offset calculation in domino's replacement logic shifted. This misalignment caused domino to fail to replace or escape the closing tag, leaving it raw and unescaped in the output HTML. An attacker who controls the dynamic text can supply a payload containing both an astral Unicode character and a closing tag (e.g., 😀</iframe><script>alert(1)</script>). When serialized on the server during SSR, the browser parses the unescaped closing tag, exits the raw-text context early, and executes the subsequent <script> block, leading to same-origin Cross-Site Scripting (XSS). This vulnerability is fixed in 22.0.0-rc.2, 21.2.16, 20.3.24, and 19.2.25.
📍 영향받는 시스템
@angular/platform-server (22.0.0-rc.2, 21.2.16, 20.3.24, 19.2.25 미만 버전)
⚔️ 공격 벡터
사용자 입력값에 이모지와 닫는 태그(예: 😀</script>)를 조합하여 서버 사이드 렌더링 시 스크립트 실행 유도
🛡️ 대응 방법
Angular 프레임워크를 수정된 버전(22.0.0-rc.2, 21.2.16, 20.3.24, 19.2.25 이상)으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 취약점이 해결된 버전(22.0.0-rc.2, 21.2.16, 20.3.24, 19.2.25 이상)인지 확인하십시오.
npm list @angular/platform-server
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
💻 영향받는 소프트웨어
IBM WebSphere Application Server