🇰🇷 한글 설명
Velocity.js는 Apache Velocity 템플릿 엔진의 JavaScript 구현체입니다. 2.1.7 이전 버전에서는 이전 패치(CVE-2026-44966)가 #set 할당 처리기에만 constructor, __proto__, prototype 필터를 적용하고 속성 읽기 표현식(references.ts)에는 필터를 적용하지 않아, 공격자가 constructor.constructor를 통해 JavaScript Function 생성자에 접근할 수 있습니다. 이로 인해 서버에서 임의의 셸 명령 실행이 가능합니다.
💡 쉬운 설명
템플릿에 특정 문법을 몰래 넣으면 서버를 장악할 수 있는 심각한 취약점입니다. 공격자가 서버의 명령어, 환경변수, 클라우드 인증정보까지 빼갈 수 있습니다.
🇺🇸 원문 (English)
Velocity.js is a JavaScript implementation of the Apache Velocity template engine. Prior to 2.1.7, the earlier fix for CVE-2026-44966 filtered constructor, __proto__, and prototype only in the #set assignment handler in src/compile/set.ts, while property-read expressions in src/compile/references.ts remained unfiltered. The getReferences() flow called getAttributes(), whose property access allowed an attacker-controlled template to traverse constructor.constructor to the JavaScript Function constructor. The #set handler validated only the assignment target and did not inspect the right-hand property-read expression, allowing arbitrary shell commands, environment-variable access, cloud-credential access, and internal-network access in the server process. This issue is fixed in version 2.1.7.
📍 영향받는 시스템
Velocity.js 2.1.7 미만 버전을 사용하는 모든 Node.js 애플리케이션
⚔️ 공격 벡터
사용자 입력이 포함된 템플릿에서 #set 및 속성 읽기 표현식으로 constructor.constructor를 호출해 임의 코드를 실행
🛡️ 대응 방법
Velocity.js를 2.1.7 이상으로 업그레이드하고, 사용자 입력을 템플릿으로 직접 사용하지 않도록 수정
🔧 검증 코드
출력된 버전이 2.1.7 미만이면 취약하며, 2.1.7 이상이면 패치가 적용된 상태입니다.
npm ls velocityjs 2>/dev/null | grep velocityjs