🇰🇷 한글 설명
PHP용 템플릿 엔진인 Twig 3.26.0 미만 버전에서 발생하는 취약점입니다. {% use %} 태그의 템플릿 이름이 PHP 단일 인용 부호 문자열 내에 배치될 때 작은따옴표를 이스케이프하지 않아, 조작된 템플릿 이름을 통해 임의의 PHP 코드를 주입할 수 있습니다.
💡 쉬운 설명
템플릿 이름에 특수 문자를 넣어 프로그램의 규칙을 깨뜨리는 공격입니다. 이를 통해 해커가 서버에서 원하는 명령어를 마음대로 실행할 수 있습니다.
🇺🇸 원문 (English)
Twig is a template language for PHP. Prior to 3.26.0, Compiler::string() does not escape single quotes when a template name from a {% use %} tag is placed inside a PHP single-quoted string literal, allowing a crafted template name to terminate the string and inject arbitrary PHP expressions into the compiled cache file. This issue is fixed in version 3.26.0.
📍 영향받는 시스템
Twig versions prior to 3.26.0
⚔️ 공격 벡터
조작된 템플릿 이름을 포함한 {% use %} 태그를 사용하여 컴파일된 캐시 파일에 PHP 코드 주입
🛡️ 대응 방법
Twig 버전을 3.26.0 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 정보가 3.26.0 미만인지 확인하십시오.
composer show twig/twig | grep 'versions'