🇰🇷 한글 설명
PHP용 템플릿 엔진인 Twig의 3.9.0부터 3.26.0 버전 사이에서 template_from_string() 함수가 보안 정책을 우회할 수 있는 취약점이 발견되었습니다. 샌드박스 환경 내에서 생성된 내부 템플릿 이름이 보안 정책의 검사 범위를 벗어나게 되어, 공격자가 제한된 환경을 탈출하여 임의의 코드를 실행할 수 있습니다.
💡 쉬운 설명
안전한 구역(샌드박스) 안에 갇혀 있어야 할 프로그램이 특수한 명령어를 통해 울타리를 넘어 밖으로 나갈 수 있는 보안 구멍이 발견되었습니다. 이를 통해 공격자가 원래 허용되지 않은 시스템 명령을 실행할 위험이 있습니다.
🇺🇸 원문 (English)
Twig is a template language for PHP. From 3.9.0 until 3.26.0, template_from_string() compiles an inner template under a synthesized __string_template__<hash> name that can fall outside a SourcePolicyInterface sandbox decision, allowing a sandboxed template that can call template_from_string and include to render an inner template without security policy enforcement. This issue is fixed in version 3.26.0.
📍 영향받는 시스템
Twig PHP library versions 3.9.0 to 3.26.0
⚔️ 공격 벡터
샌드박스 내에서 template_from_string()과 include를 조합하여 보안 정책이 적용되지 않는 내부 템플릿을 호출하는 방식
🛡️ 대응 방법
Twig 라이브러리를 최신 보안 패치가 적용된 버전인 3.26.0 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 정보가 3.26.0 미만(예: 3.9.0 ~ 3.25.x)이면 취약한 상태입니다.
composer show twig/twig | grep 'versions'