CVE-2024-8373 (영문)

콘텐츠 스푸핑
영향
AngularJS
>=1.3.0-rc.4
in
AngularJS
항목을 찾을 수 없습니다.
느낌표 아이콘
패치 사용 가능
이 취약점은 HeroDevs에서 제공하는 네버엔딩 지원(NES) 버전에서 수정되었습니다.

개요

AngularJS는 동적 웹 애플리케이션을 개발하기 위한 자바스크립트 프레임워크입니다. HTML을 템플릿 언어로 사용할 수 있으며 HTML의 구문을 확장하여 애플리케이션의 구성 요소를 명확하고 간결하게 표현할 수 있습니다.

An improper sanitization vulnerability (CVE-2024-8373) has been identified in AngularJS, which allows attackers to bypass common image source restrictions normally applied to the value of the [srcset] attribute on <source> HTML elements. This bypass can further lead to a form of Content Spoofing.

OWASP 기준: 콘텐츠 스푸핑은 콘텐츠 인젝션, "임의 텍스트 인젝션" 또는 가상 변조라고도 하며, 웹 애플리케이션의 인젝션 취약점을 통해 사용자를 대상으로 하는 공격입니다. 애플리케이션이 사용자가 제공한 데이터를 제대로 처리하지 못하는 경우 공격자는 일반적으로 매개변수 값을 통해 웹 애플리케이션에 콘텐츠를 제공할 수 있으며, 이 콘텐츠는 사용자에게 다시 반영됩니다. 이렇게 하면 사용자에게 신뢰할 수 있는 도메인의 컨텍스트에 따라 수정된 페이지가 표시됩니다.

이 문제는 모든 버전의 AngularJS에 영향을 줍니다.

세부 정보

모듈 정보

취약점 정보

이 중간 심각도 취약점은 게시된 모든 버전의 AngularJS에 있는 기본 angular 패키지에서 발견됩니다.

Normally, setting an <img> or <source> element's srcset attribute value is subject to image source sanitization, which allows improving the security of an application by setting restrictions on the sources of images that can be shown. For example, only allowing images from a specific domain.

However, due to a bug in AngularJS, setting a <source> element’s srcset attribute via the ngAttrSrcset directive or interpolation is not subject to image source sanitization. This allows bypassing the image source restrictions configured in the application, which can also lead to a form of Content Spoofing.

참고:

ngSrcsetngPropSrcset 지시어는 영향을 받지 않습니다. 이러한 지시어를 사용하면 살균이 의도한 대로 작동합니다.

재현 단계

  • AngularJS 애플리케이션을 만들고 특정 도메인의 이미지만 허용하도록 $compileProvider를 구성합니다. 예를 들어
angular
    .module('app', [])
    .config(['$compileProvider', $compileProvider => {
      $compileProvider.imgSrcSanitizationTrustedUrlList(
          // Only allow images from `angularjs.org`.
          /^https:\/\/angularjs\.org\//);
    }]);

  • Use a specially-crafted value in the ngAttrSrcset directive on a <source> element to bypass the domain restriction and show an image from a disallowed domain. For example:
<picture>
  <source ng-attr-srcset="https://angular.dev/favicon.ico" />
  <img src="" />
</picture>

  • 데이터:이미지/svg+xml 형식을 사용하여 임의의 SVG 이미지를 표시할 수도 있습니다. 예를 들어
<picture>
  <source ng-attr-srcset="data:image/svg+xml;base64,..." />
  <img src="" />
</picture>

  • 마찬가지로 srcset HTML 속성에서 보간을 사용하여 동일한 결과를 얻을 수 있습니다. 예를 들어
<picture>
  <source srcset="{{ 'https://angular.dev/favicon.ico' }}" />
  <!--
    OR:
    <source srcset="{{ 'data:image/svg+xml;base64,...' }}" />
  --> 
  <img src="" />
</picture>

개념 증명

A full reproduction with code similar to the above can be found here:
<source> sanitization vulnerability POC

완화

AngularJS 프로젝트는 수명이 종료되었으며 이 문제를 해결하기 위한 업데이트가 제공되지 않습니다. 자세한 내용은 여기를 참조하세요.

영향을 받는 구성 요소의 사용자는 다음 완화 방법 중 하나를 적용해야 합니다:

  • 영향을 받는 애플리케이션을 AngularJS에서 마이그레이션하세요.
  • 히어로데브즈와 같은 상용 지원 파트너를 활용하여 EOL 이후 보안 지원을 받으세요.
취약점 세부 정보
ID
CVE-2024-8373 (영문)
영향을 받는 프로젝트
AngularJS
영향을 받는 버전
>=1.3.0-rc.4
게시 날짜
2024년 9월 9일
≈ 수정 날짜
2024년 5월 21일
다음에서 수정되었습니다.
심각도
Medium
카테고리
콘텐츠 스푸핑