🇰🇷 한글 설명
hbs 뷰 엔진의 registerAsyncHelper API가 Handlebars의 자동 HTML 이스케이프 기능을 우회하는 취약점입니다. 비동기 헬퍼가 반환하는 값이 이스케이프 처리 없이 원본 그대로 렌더링되어, 공격자가 조작한 데이터가 포함될 경우 저장형 또는 반사형 XSS 공격이 가능합니다.
💡 쉬운 설명
웹사이트 화면을 만드는 도구에서 보안 검사를 건너뛰는 구멍이 발견되었습니다. 이를 통해 해커가 악성 스크립트를 심어 사용자의 정보를 훔칠 수 있습니다.
🇺🇸 원문 (English)
hbs is an Express view engine that wraps Handlebars. Its registerAsyncHelper API bypasses Handlebars' automatic HTML escaping: an async helper returns an opaque placeholder during the first render pass, so the double-brace expression escapes only the placeholder, and after rendering hbs substitutes the placeholder with the raw callback return value without escaping it, across the cached, uncached, and layout render paths. An application that passes attacker-influenced data, for example user-supplied content from a database, into an async helper callback can therefore have arbitrary HTML and JavaScript injected into the server-rendered page, resulting in stored or reflected cross-site scripting. Versions 2.1.0 through 4.2.1 are affected, and the issue is fixed in 4.3.0, which HTML-escapes async helper output. Applications that intentionally emit raw HTML from an async helper can opt in explicitly with hbs.SafeString. Users should upgrade to 4.3.0.
📍 영향받는 시스템
hbs versions 2.1.0 through 4.2.1
⚔️ 공격 벡터
사용자 입력값이 포함된 데이터를 비동기 헬퍼 콜백에 전달하여 악성 HTML/JavaScript 주입
🛡️ 대응 방법
hbs 버전을 4.3.0 이상으로 업그레이드
🔧 검증 코드
출력된 버전이 4.3.0 미만(2.1.0 ~ 4.2.1 사이)이면 취약한 상태입니다.
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
💻 영향받는 소프트웨어
IBM WebSphere Application Server