🇰🇷 한글 설명
Twig 2.16.x 및 3.9.0~3.25.x 버전에서 SourcePolicyInterface 사용 시 sort, filter, map, reduce 필터에 임의의 PHP callable을 전달할 수 있는 샌드박스 우회 취약점입니다. 런타임 체크가 현재 템플릿 소스를 확인하지 않아 샌드박스가 활성화되어 있어도 임의 코드 실행이 가능합니다.
💡 쉬운 설명
Twig 웹 템플릿 도구의 보안 제한을 우회할 수 있는 결함입니다. 공격자가 특수한 코드를 템플릿에 주입하여 서버에서 임의의 명령을 실행할 수 있습니다.
🇺🇸 원문 (English)
Twig versions 2.16.x and 3.9.0 through 3.25.x contain a sandbox bypass vulnerability when using a SourcePolicyInterface that allows attackers with template rendering capabilities to pass arbitrary PHP callables to sort, filter, map, and reduce filters. Attackers can exploit the runtime check that fails to use the current template source to bypass sandbox restrictions and execute arbitrary code when the sandbox is enabled through a source policy rather than globally.
📍 영향받는 시스템
Twig 2.16.x, 3.9.0~3.25.x
⚔️ 공격 벡터
SourcePolicyInterface 설정 하에서 sort/filter/map/reduce 필터에 PHP callable을 주입하여 샌드박스 검증 우회
🛡️ 대응 방법
Twig를 3.9.0 이전 버전 또는 3.25.x 이후 최신 버전으로 업그레이드
🔧 검증 코드
버전이 2.16.x 또는 3.9.0~3.25.x 범위에 있으면 취약함. 안전한 버전(3.9.0 이전 또는 3.25.x 이후)으로 업데이트 필요
php -r "require_once('vendor/autoload.php'); echo \Twig\Environment::VERSION;" 2>/dev/null || grep -h version vendor/twig/twig/composer.json 2>/dev/null