dduk-ddak / coding-night-live

Web-based Communication Application for Codelabs
Other
62 stars 11 forks source link

script 실행 취약점 #95

Closed punkyoon closed 7 years ago

punkyoon commented 7 years ago

채팅창에서

<script>console.log("hello");</script>
<script>$('#slide_list_row').height(1);</script>
<script>alert('메롱'); location.href='http://github.com';</script>
<h1>Hello</h1>

위와같은 채팅을 입력하면 같은 방에 있는 모든 유저들이 스크립트의 영향을 받습니다.

punkyoon commented 7 years ago

kakaotalk_20170417_232718481

kakaotalk_20170417_232344711

juice500ml commented 7 years ago

고쳐야 되는 부분: https://github.com/dduk-ddak/coding-night-live/blob/master/static/js/cnl_chats.js#L287-L315 obj.description이 pure text로 들어감.

힌트: http://stackoverflow.com/questions/9735045/is-jquery-text-method-xss-safe

@taeseunglee 해보실?

juice500ml commented 7 years ago

동일 취약점이 전체에 걸쳐있음 ㅠ

Poll 취약점 https://github.com/dduk-ddak/coding-night-live/blob/master/static/js/cnl_chats.js#L379

Notice 취약점 https://github.com/dduk-ddak/coding-night-live/blob/master/static/js/cnl_chats.js#L342

taeseunglee commented 7 years ago

그래!

punkyoon commented 7 years ago

채팅창으로 들어오는 모든 값들에 대해서 처리를 해줘야하네요

taeseunglee commented 7 years ago

기존의 out part의 모습.

2017-04-25 3 51 33

현재의 수정한 out part의 모습.

2017-04-25 3 52 21

이 부분도 이렇게 바꾸면 되겠죠!?

@punkyoon @juice500ml @fuzzythecat @minhoryang 여러분들은 어떤 것이 좋다고(혹은 옳다?) 생각하시나요!?

juice500ml commented 7 years ago

수정한게 정확한거같아요!! :+1:

punkyoon commented 7 years ago

수정한게 맞다고 생각합니다!

minhoryang commented 7 years ago

엌ㅋㅋㅋㅋㅋ이게뭐얔ㅋㅋㅋㅋㅋㅋ내눈!!!