🇰🇷 한글 설명
NiceGUI는 Python 기반의 UI 프레임워크입니다. 버전 2.13.0부터 3.4.1까지 개발자가 공격자 제어 문자열을 ui.navigate.history.push() 또는 ui.navigate.history.replace()에 전달할 때 XSS 위험이 있습니다. 이러한 헬퍼 함수는 브라우저 URL을 페이지 리로드 없이 업데이트하는 History API 래퍼로 문서화되어 있습니다. 그러나 URL 인수가 프로퍼티 이스케이프 없이 생성된 JavaScript에 삽입되면 제작된 페이로드가 의도된 문자열 контек스트를 벗어나 피해자의 브라우저에서 임의의 JavaScript를 실행할 수 있습니다. 신뢰할 수 없는 입력을 ui.navigate.history.push/replace에 전달하지 않는 애플리케이션은 영향을 받지 않습니다. 이 문제는 버전 3.5.0에서 패치되었습니다.
💡 쉬운 설명
NiceGUI 프레임워크의 XSS 취약점으로 인해 공격자가 임의의 JavaScript 코드를 실행할 수 있습니다. 개발자가 신뢰할 수 없는 입력을 특정 함수에 전달할 때 발생합니다. 버전 3.5.0으로 업데이트하면 문제가 해결됩니다.
🇺🇸 원문 (English)
NiceGUI is a Python-based UI framework. From versions 2.13.0 to 3.4.1, there is a XSS risk in NiceGUI when developers pass attacker-controlled strings into ui.navigate.history.push() or ui.navigate.history.replace(). These helpers are documented as History API wrappers for updating the browser URL without page reload. However, if the URL argument is embedded into generated JavaScript without proper escaping, a crafted payload can break out of the intended string context and execute arbitrary JavaScript in the victim’s browser. Applications that do not pass untrusted input into ui.navigate.history.push/replace are not affected. This issue has been patched in version 3.5.0.
📍 영향받는 시스템
NiceGUI 버전 2.13.0 ~ 3.4.1
⚔️ 공격 벡터
신뢰할 수 없는 입력을 ui.navigate.history.push 또는 ui.navigate.history.replace에 전달
🛡️ 대응 방법
NiceGUI를 버전 3.5.0으로 업데이트합니다.
🔧 검증 코드
Python 환경에서 nicegui 패키지의 버전을 확인합니다. Python이 설치되어 있고 nicegui 패키지가 설치된 상태에서 코드를 실행합니다.
import pkg_resources
version = pkg_resources.get_distribution('nicegui').version
if version >= '3.5.0':
print({"result": "양호", "reason": "NiceGUI 버전이 3.5.0 이상"})
else:
print({"result": "취약", "reason": "NiceGUI 버전이 3.5.0 미만"})