🇰🇷 한글 설명
jmespath.php 2.9.1 이전 버전은 공격자가 제어하는 JMESPath 표현식을 사용하여 `JmesPath\CompilerRuntime` 실행 시 PHP 코드를 생성 및 실행할 수 있는 심각한 취약점이 있습니다. 컴파일러가 생성한 PHP 소스 코드가 충분히 이스케이프되지 않아 악성 코드가 캐시 파일에 포함되고 로드됩니다.
💡 쉬운 설명
이 취약점은 공격자가 악의적인 명령을 입력해 시스템이 자동으로 위험한 PHP 코드를 실행하도록 만듭니다. 버전 2.9.1로 업그레이드하거나, 신뢰할 수 없는 입력에는 컴파일러 런타임 대신 기본 런타임을 사용해야 합니다.
🇺🇸 원문 (English)
jmespath.php allows users to use JMESPath, software for declaratively specifying how to extract elements from a JSON document, in PHP applications with PHP data structures. Versions prior to 2.9.1 can generate and execute attacker-controlled PHP code when `JmesPath\CompilerRuntime` is used with an attacker-controlled JMESPath expression. The compiler emits parsed JMESPath function names into generated PHP source without sufficient escaping. A crafted expression can cause the generated cache file to contain executable attacker-controlled PHP, which is then loaded by the compiler runtime. The issue is patched in `2.9.1` and later. As a workaround, disable `JP_PHP_COMPILE` and do not use `JmesPath\CompilerRuntime` with attacker-controlled expressions. Use the default `AstRuntime` for untrusted expressions. Applications that must continue accepting untrusted JMESPath expressions before upgrading should ensure those expressions are never evaluated by the compiler runtime.
📍 영향받는 시스템
jmespath.php versions prior to 2.9.1
⚔️ 공격 벡터
공격자가 제어하는 JMESPath 표현식을 `JmesPath\CompilerRuntime`에 전달하여 악성 PHP 코드 생성 및 실행 유도
🛡️ 대응 방법
jmespath.php를 2.9.1 이상으로 업그레이드하거나 JP_PHP_COMPILE를 비활성화하고 기본 AstRuntime을 사용하십시오.
🔧 검증 코드
출력된 버전이 2.9.1 미만인 경우 취약한 버전이 설치되어 있음을 의미합니다.
composer show jmespath/jmespath 2>/dev/null | grep -E 'versions' | grep -vE '2\.9\.[1-9]|2\.[1-9][0-9]|[3-9]\.'