CSTI injection

2024. 9. 23. 01:40Web Security/웹 해킹

CSTI(Client-Side Template Injection)은 공격자가 Template 코드를 기존 template에 include 시켜서 원하는 액션을 수행하도록 하는 공격입니다. 이 때 template injection이 발생하는 위치가 client-side인 경우 CSTI라고 부릅니다.

 

 

CSTI 가 발생되기 위해서는 템플릿 엔진이 존재해야 합니다. 템플릿 엔진으로는 VueJS, AngularJS, React이  존재합니다.

CSTI가 존재하는지 확인하기 위해서는 산순연산자를 넣어보는 것도 방법이다 {{ 1+1 }} 를 넣었을 때 2가 나온다면 csti 취약점이 존재한다고 판단할 수 있다. 

 

 

JS 코드는 생성자에 접근하여 코드를 실행 시킬 수 있다.

 

VueJS의 경우

<script src="https://unpkg.com/vue@3"></script>

{{_Vue.h.constructor("alert(1)")()}}

 

 AngularJS의 경우

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.3/angular.min.js"></script>

{{ constructor.constructor("alert(1)")() }}

 

 

 

'Web Security > 웹 해킹' 카테고리의 다른 글

NO-SQL injection  (2) 2024.10.02
sql injection  (6) 2024.10.02
CSS injection  (0) 2024.09.23
Relative Path Overwrite  (0) 2024.09.22
CSP : Content-Security-Policy  (1) 2024.09.19