의미없는 블로그

[Appscan] X-Content-Type-Options: nosniff 본문

카테고리 없음

[Appscan] X-Content-Type-Options: nosniff

SaltLee 2025. 2. 12. 11:02

 

Content-Type: application/xml

Content-Type: application/octet-stream

Content-Type: text/plain

Content-Type: application/javascript 

 

.jpg 파일에 자바스크립트 담아서 업로드 하면

MIME 이 image/jpeg 이지만

내용이 <script>alert(1)</scrip> 니까

브라우저로 실행시킬 수 있다

 

X-Content-Type-Options: sniff 헤더 설정하면

MIME 이 image/jpeg 면 실행 안시킨다

Javascript 차단 가능

 

res.addHeader("X-Content-Type-Options", "nosniff")

 

https://webhack.dynu.net/?idx=20161120.001

Comments