🇰🇷 한글 설명
LiquidJS의 {% include %}, {% render %}, {% layout %} 태그에서 경로 검증 시 실제 경로(realpath)가 아닌 단순 경로 문자열만 확인하는 취약점이 존재합니다. 이를 통해 공격자가 허용된 루트 디렉토리 내에 심볼릭 링크를 생성하면, 루트 외부의 임의 파일을 읽어 렌더링할 수 있습니다.
💡 쉬운 설명
금지된 구역의 파일을 읽지 못하게 막는 보안 장치가 실제 파일의 연결 경로를 확인하지 않고 이름만 확인하는 문제입니다. 공격자가 가짜 연결 통로(심볼릭 링크)를 만들어 서버의 중요한 비밀 파일을 몰래 훔쳐볼 수 있습니다.
🇺🇸 원문 (English)
LiquidJS is a Shopify / GitHub Pages compatible template engine in pure JavaScript. Prior to 10.25.3, for {% include %}, {% render %}, and {% layout %}, LiquidJS checks whether the candidate path is inside the configured partials or layouts roots before reading it. That check is path-based, not realpath-based. Because of that, a file like partials/link.liquid passes the directory containment check as long as its pathname is under the allowed root. If link.liquid is actually a symlink to a file outside the allowed root, the filesystem follows the symlink when the file is opened and LiquidJS renders the external target. So the restriction is applied to the path string that was requested, not to the file that is actually read. This matters in environments where an attacker can place templates or otherwise influence files under a trusted template root, including uploaded themes, extracted archives, mounted content, or repository-controlled template trees. This vulnerability is fixed in 10.25.3.
📍 영향받는 시스템
LiquidJS 10.25.3 미만 버전
⚔️ 공격 벡터
템플릿 루트 디렉토리에 외부 파일을 가리키는 심볼릭 링크를 생성하여 경로 제한을 우회하고 임의 파일을 읽음
🛡️ 대응 방법
LiquidJS를 10.25.3 버전 이상으로 업데이트
🔧 검증 코드
출력된 LiquidJS 버전이 10.25.3보다 낮은 버전인지 확인하십시오.
npm list liquidjs | grep -E 'liquidjs@([0-9]*\.)?[0-9]*\.[0-9]*'