🇰🇷 한글 설명
LiquidJS 10.27.2 미만 버전에서 join 및 array_to_sentence_string 필터의 복잡도 계산 오류로 인해 메모리 제한을 우회할 수 있는 취약점이 존재합니다. 공격자가 조작된 템플릿을 사용하여 실제 생성되는 문자열 크기보다 훨씬 적은 메모리 비용만 계산되도록 유도함으로써, 설정된 메모리 제한을 초과하여 프로세스를 중단시킬 수 있습니다.
💡 쉬운 설명
템플릿 엔진이 실제 만들어지는 데이터의 크기를 제대로 계산하지 못하는 허점이 있습니다. 이를 악용하면 아주 작은 명령만으로도 컴퓨터의 메모리를 순식간에 가득 채워 프로그램을 강제로 종료시킬 수 있습니다.
🇺🇸 원문 (English)
LiquidJS is a Shopify / GitHub Pages compatible template engine in pure JavaScript. Prior to 10.27.2, the join filter in src/filters/array.ts computes complexity from array.length and separator length instead of the total string length produced by array.join(sep). The concat filter can cheaply double arrays of references, after which join materializes the referenced content while charging only for element count, allowing a template to exceed a configured memoryLimit by a large factor. The sibling array_to_sentence_string filter in src/filters/string.ts has the same accounting defect, and a crafted template can allocate toward V8's string or process memory limit and crash the process. This issue is fixed in version 10.27.2.
📍 영향받는 시스템
LiquidJS versions prior to 10.27.2
⚔️ 공격 벡터
조작된 템플릿을 통해 concat 필터로 배열을 복제한 후 join 필터를 사용하여 메모리 할당량을 조작하는 방식
🛡️ 대응 방법
LiquidJS를 10.27.2 이상의 최신 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 10.27.2보다 낮으면 취약한 상태이며, 10.27.2 이상이면 안전합니다.
npm list liquidjs | grep -E 'liquidjs@([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2})'