🇰🇷 한글 설명
파이썬 웹 프레임워크인 Tornado에서 HTTP 헤더와 HTML 에러 페이지에 사용자 제공 reason 문구가 이스케이프 처리되지 않아 헤더 인젝션과 XSS 공격에 취약
💡 쉬운 설명
Tornado 웹 프레임워크의 버그로 인해 악의적인 사용자가 HTTP 헤더나 에러 페이지에 악의적인 코드를 삽입할 수 있습니다. 이는 사용자 제공 reason 문구가 제대로 이스케이프 처리되지 않아 발생합니다. 버전 6.5.2 이하에서 발생하며, 6.5.3 버전에서 해결됩니다.
🇺🇸 원문 (English)
Tornado is a Python web framework and asynchronous networking library. In versions 6.5.2 and below, the supplied reason phrase is used unescaped in HTTP headers (where it could be used for header injection) or in HTML in the default error page (where it could be used for XSS) and can be exploited by passing untrusted or malicious data into the reason argument. Used by both RequestHandler.set_status and tornado.web.HTTPError, the argument is designed to allow applications to pass custom "reason" phrases (the "Not Found" in HTTP/1.1 404 Not Found) to the HTTP status line (mainly for non-standard status codes). This issue is fixed in version 6.5.3.
📍 영향받는 시스템
Tornado 6.5.2 및 이전 버전
⚔️ 공격 벡터
사용자 제공 reason 문구를 악의적인 코드로 조작하여 HTTP 헤더 인젝션 또는 XSS 공격을 수행
🛡️ 대응 방법
Tornado를 6.5.3 버전 이상으로 업그레이드
🔧 검증 코드
로컬 시스템에서 Python을 실행하고, Tornado 라이브러리의 버전을 확인하여 취약점 여부를 점검
import tornado
version = tornado.version
if version.version < '6.5.3':
print({"result": "취약", "reason": "Tornado 버전이 6.5.3 미만"})
else:
print({"result": "양호", "reason": "Tornado 버전이 6.5.3 이상"})