CSS Injection
- 노트필기
- 2026. 6. 10.
웹 페이지 로딩 시 악의적인 동작을 이끄는 공격 - 임의의 CSS 속성을 삽입하여 웹 페이지 내 데이터를 훔침
- CSRF Token, API Key 등 웹 페이지에 직접적으로 보여지는 값처럼 CSS Selector를 통해 표현이 가능해야 함
<style>
body { background-color: ${theme}; }
</style>
<h1>Hello, it's dreame. Interesting with CSS Injection?</h1>
theme 값을 이용하여 다른 속성도 바꿀 수 있
<style>
body { background-color: yellow; } h1 { color: red; }
</style>
<h1>Hello, it's dreame. Interesting with CSS Injection?</h1>
CSS 가젯 정리
https://github.com/cure53/HTTPLeaks
ping back 예시
<style>
body { background-color: yellow; background: url("https://aaaaaaa.request.dreamhack.games/ping-back"); }
</style>
<h1>Hello, it's dreame. Interesting with CSS Injection?</h1>
CSS Attribute SElector
https://developer.mozilla.org/ko/docs/Web/CSS/Reference/Selectors/Attribute_selectors
특성 선택자 - CSS: Cascading Style Sheets | MDN
developer.mozilla.org
input[value^=pw1235]{padding: 100px;)