🇰🇷 한글 설명
Handlebars 4.0.0부터 4.7.10 버전까지 compile() 및 precompile() 함수가 AST 객체를 처리할 때 특정 값들에 대한 검증을 누락하는 취약점이 발견되었습니다. 공격자가 템플릿 문자열 대신 조작된 객체를 전달할 경우, 검증되지 않은 필드에 삽입된 JavaScript 코드가 실행되어 서버 프로세스에서 원격 코드 실행(RCE)이 가능해집니다.
💡 쉬운 설명
템플릿을 만드는 도구인 Handlebars의 검증 기능에 구멍이 생겨, 공격자가 악성 코드가 담긴 특수한 데이터를 보낼 수 있습니다. 이 데이터가 처리되면 공격자가 서버를 마음대로 조종할 수 있는 위험한 상태가 됩니다.
🇺🇸 원문 (English)
Handlebars provides the power necessary to let users build semantic templates. From 4.0.0 until 4.7.10, Handlebars.compile() and Handlebars.precompile() accept pre-parsed AST objects while validating only selected PathExpression, NumberLiteral, and BooleanLiteral values. This issue bypasses the AST validation introduced in version 4.7.9 for CVE-2026-33937. An attacker who can supply an object instead of a template string can place JavaScript expressions in unchecked values such as Program.blockParams.length, a non-PathExpression parameter depth, a non-string StringLiteral.value, or a non-string PathExpression.original. The compiler emits those values into generated JavaScript, causing code execution in the server process when compile output renders or wherever precompile output is loaded. Applications that pass only template strings are not affected. This issue is fixed in version 4.7.10.
📍 영향받는 시스템
Handlebars versions 4.0.0 to 4.7.10
⚔️ 공격 벡터
공격자가 템플릿 문자열 대신 조작된 AST 객체를 입력값으로 전달하여 검증을 우회하고 JavaScript 코드를 실행함
🛡️ 대응 방법
Handlebars 라이브러리를 보안 패치가 적용된 4.7.10 이상의 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 4.7.10 미만(예: 4.7.9 이하)이면 취약한 상태이므로 즉시 업데이트가 필요합니다.
npm list handlebars | grep -E 'handlebars@4\.[0-9]\.[0-9]'
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
💻 영향받는 소프트웨어
IBM WebSphere Application Server