🇰🇷 한글 설명
NiceGUI 2.24.2 이하 버전에서 ui.html() 함수 사용 시 사용자 입력이 제대로 검증되지 않아 발생하는 크로스사이트 스크립팅(XSS) 취약점입니다. 공격자는 악의적인 JavaScript 코드를 포함한 입력값을 주입하여 피해자의 브라우저에서 임의의 스크립트를 실행할 수 있습니다.
💡 쉬운 설명
NiceGUI에서 사용자가 입력한 텍스트를 웹페이지에 그대로 표시할 때, 악성 코드가 포함되어 있으면 실행될 수 있습니다. 이를 통해 공격자가 사용자의 계정 정보를 탈취하거나 다른 악성 행동을 할 수 있습니다.
🇺🇸 원문 (English)
NiceGUI is a Python-based UI framework. Versions 2.24.2 and below are at risk for Cross-Site Scripting (XSS) when developers render unescaped user input into the DOM using ui.html(). NiceGUI did not enforce HTML or JavaScript sanitization, so applications that directly combine components like ui.input() with ui.html() or ui.chat_message with HTML content without escaping may allow attackers to execute arbitrary JavaScript in the user’s browser. Applications that do not pass untrusted input into ui.html() are not affected. This issue is fixed in version 3.0.0.
📍 영향받는 시스템
NiceGUI 버전 2.24.2 이하 (3.0.0에서 수정)
⚔️ 공격 벡터
ui.html() 함수에 검증되지 않은 사용자 입력을 전달하여 DOM에 직접 렌더링될 때 XSS 페이로드 실행
🛡️ 대응 방법
NiceGUI를 3.0.0 이상으로 업그레이드하거나, 사용자 입력을 HTML 인코딩/이스케이핑하여 전달
🔧 검증 코드
출력된 버전 번호가 3.0.0 이상이면 안전, 2.24.2 이하이면 취약
pip show nicegui 2>/dev/null | grep Version || python3 -c "import nicegui; print(nicegui.__version__)" 2>/dev/null