🇰🇷 한글 설명
Angular의 @angular/core 및 @angular/compiler에서 SecurityContext가 실제 호스트 요소가 아닌 선언된 디렉티브나 컴포넌트 셀렉터로부터 유도되는 취약점입니다. 이로 인해 보안 민감한 디렉티브 호스트 바인딩 시 잘못된 Sanitizer가 선택되거나 생략될 수 있습니다. 공격자는 이를 악용하여 href, src 등의 속성에 악성 스크립트를 삽입하고 사용자 브라우저에서 임의의 자바스크립트를 실행할 수 있습니다.
💡 쉬운 설명
웹사이트를 만들 때 사용하는 Angular 도구에서 보안 검사 기능이 제대로 작동하지 않는 오류가 발견되었습니다. 공격자가 웹사이트의 특정 링크나 이미지 주소에 악성 코드를 심어 사용자의 정보를 훔칠 수 있습니다.
🇺🇸 원문 (English)
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 20.3.28, 21.2.20, and 22.1.0, Angular's compiler and runtime in @angular/core and @angular/compiler could omit or select an incorrect sanitizer for security-sensitive directive host bindings because SecurityContext was derived from the declaring directive or component selector rather than the concrete host element. The mismatch is reachable through hostDirectives composition, inherited HostBinding declarations, createComponent with a custom hostElement or dynamic directives, SVG/MathML namespace elements, and tag-neutral selectors such as :not(...). Attacker-controlled href, src, action, xlink:href, or data values can therefore reach DOM attributes without Angular's built-in sanitizer and execute arbitrary JavaScript in the user's browser context. Applications unable to upgrade can use DomSanitizer.sanitize with SecurityContext.URL before assignment or restrict inputs to validated HTTP and HTTPS URL schemes. This issue is fixed in versions 20.3.28, 21.2.20, and 22.1.0.
📍 영향받는 시스템
Angular versions prior to 20.3.28, 21.2.20, and 22.1.0 (@angular/core, @angular/compiler)
⚔️ 공격 벡터
hostDirectives, 상속된 HostBinding, 또는 동적 디렉티브를 통해 조작된 href, src, action 등의 속성 값을 주입하여 XSS 공격 수행
🛡️ 대응 방법
Angular를 20.3.28, 21.2.20 또는 22.1.0 이상의 버전으로 업데이트하거나, DomSanitizer.sanitize(SecurityContext.URL)를 사용하여 수동으로 검증해야 합니다.
🔧 검증 코드
출력된 버전이 취약점이 해결된 버전(20.3.28, 21.2.20, 22.1.0 이상)인지 확인합니다.
npm list @angular/core @angular/compiler