🔍 CVE-2026-25129

6.7
CVSS Score
MEDIUM
2026-01-30
2026-01-30 21:15
✅ 완료

🇰🇷 한글 설명

PsySH는 PHP 런타임 개발자 콘솔, 대화형 디버거 및 REPL입니다. 0.11.23 및 0.12.19 이전 버전에서는 PsySH가 현재 작업 디렉토리(CWD)에서 `.psysh.php` 파일을 자동으로 로드하고 실행합니다. 공격자가 피해자의 CWD에서 PsySH를 실행하기 전에 디렉토리에 쓸 수 있는 경우, 공격자는 임의의 코드를 실행할 수 있습니다. 이것은 CWD 구성 오염으로 인해 피해자 사용자의 컨텍스트에서 임의의 코드를 실행하는 문제입니다.

💡 쉬운 설명

PsySH는 PHP 개발을 위한 도구로, 자동으로 `.psysh.php` 파일을 로드합니다. 공격자는 이 파일을 조작하여 코드를 실행할 수 있으므로, 권한이 높은 사용자에게 치명적입니다. PsySH의 버전을 업데이트하여 이 문제를 해결할 수 있습니다.

🇺🇸 원문 (English)

PsySH is a runtime developer console, interactive debugger, and REPL for PHP. Prior to versions 0.11.23 and 0.12.19, PsySH automatically loads and executes a `.psysh.php` file from the Current Working Directory (CWD) on startup. If an attacker can write to a directory that a victim later uses as their CWD when launching PsySH, the attacker can trigger arbitrary code execution in the victim's context. When the victim runs PsySH with elevated privileges (e.g., root), this results in local privilege escalation. This is a CWD configuration poisoning issue leading to arbitrary code execution in the victim user’s context. If a privileged user (e.g., root, a CI runner, or an ops/debug account) launches PsySH with CWD set to an attacker-writable directory containing a malicious `.psysh.php`, the attacker can execute commands with that privileged user’s permissions, resulting in local privilege escalation. Downstream consumers that embed PsySH inherit this risk. For example, Laravel Tinker (`php artisan tinker`) uses PsySH. If a privileged user runs Tinker while their shell is in an attacker-writable directory, the `.psysh.php` auto-load behavior can be abused in the same way to execute attacker-controlled code under the victim’s privileges. Versions 0.11.23 and 0.12.19 patch the issue.

📍 영향받는 시스템

PsySH 0.11.23 및 0.12.19 이전 버전, Laravel Tinker 등 PsySH를 사용하는 시스템

⚔️ 공격 벡터

공격자는 `.psysh.php` 파일을 조작하여 임의의 코드를 실행합니다. 이를 위해 공격자는 피해자의 CWD에 쓸 수 있어야 합니다.

🛡️ 대응 방법

PsySH를 0.11.23 또는 0.12.19 이상으로 업데이트하고, `.psysh.php` 파일의 접근 권한을 제한합니다.

🔧 검증 코드

이 코드는 Composer를 사용하여 PsySH의 버전을 확인합니다. Python 3.x와 Composer가 설치되어 있어야 합니다. 코드를 실행하기 전에 Composer로 PsySH를 설치해야 합니다.

Shell / Script
python -c "import subprocess; result = subprocess.run(['composer', 'show', 'psysh/psysh'], capture_output=True, text=True); if '0.11.23' in result.stdout or '0.12.19' in result.stdout: print('{"result": "양호", "reason": "PsySH 버전이 최신입니다."}'); else: print('{"result": "취약", "reason": "PsySH 버전이 구버전입니다."}')"

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

PHP