CVE-2026-25129: CWE-427: Uncontrolled Search Path Element in bobthecow psysh
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.
AI Analysis
Technical Summary
CVE-2026-25129 is a vulnerability classified under CWE-427 (Uncontrolled Search Path Element) affecting PsySH, a popular interactive PHP REPL and debugger. PsySH versions before 0.11.23 and between 0.12.0 and 0.12.19 automatically load and execute a .psysh.php configuration file from the current working directory (CWD) upon startup. This behavior introduces a security risk if an attacker can write a malicious .psysh.php file into a directory that a victim, especially a privileged user, later uses as their CWD when launching PsySH. Because the file is executed in the context of the user running PsySH, this can lead to arbitrary code execution and local privilege escalation if the user has elevated privileges (e.g., root, CI runners, or operations/debug accounts). The vulnerability extends to downstream consumers embedding PsySH, such as Laravel's Tinker console (invoked via php artisan tinker), which inherits the same risk. Exploitation requires the attacker to have write access to a directory that the victim will use as their CWD and for the victim to launch PsySH or Tinker from that directory, thus requiring local access and user interaction. The vulnerability is mitigated by upgrading PsySH to versions 0.11.23 or 0.12.19, which remove the automatic loading of .psysh.php from the CWD. The CVSS 3.1 score is 6.7 (medium), reflecting the local attack vector, required privileges, and user interaction, but high impact on confidentiality, integrity, and availability. No known exploits have been reported in the wild as of the publication date.
Potential Impact
For European organizations, this vulnerability poses a significant risk primarily in environments where PsySH or downstream tools like Laravel Tinker are used by privileged users. Development, operations, and continuous integration environments that run PHP applications and use PsySH for debugging or interactive shell access are at risk. If an attacker gains local write access to directories used by these users, they can escalate privileges, potentially compromising sensitive systems or data. This could lead to unauthorized access to critical infrastructure, data leakage, or disruption of services. Organizations with automated deployment pipelines or shared development environments are particularly vulnerable if directory permissions are not tightly controlled. The impact is heightened in sectors with strict data protection requirements, such as finance, healthcare, and government, where privilege escalation could lead to regulatory non-compliance and reputational damage.
Mitigation Recommendations
European organizations should immediately upgrade PsySH to versions 0.11.23 or 0.12.19 or later to eliminate the automatic loading of .psysh.php from the CWD. Review and restrict directory permissions to prevent untrusted users from writing files into directories that privileged users might use as their CWD. Implement policies to avoid launching PsySH or Laravel Tinker from untrusted or writable directories, especially when running with elevated privileges. Employ monitoring to detect unexpected .psysh.php files in commonly used directories. In CI/CD environments, isolate build and debug environments to prevent directory poisoning. Educate developers and operations staff about the risks of running interactive shells in attacker-writable directories. Consider using containerization or sandboxing to limit the impact of potential local exploits. Regularly audit and update PHP development tools and dependencies to incorporate security patches promptly.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden
CVE-2026-25129: CWE-427: Uncontrolled Search Path Element in bobthecow psysh
Description
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-25129 is a vulnerability classified under CWE-427 (Uncontrolled Search Path Element) affecting PsySH, a popular interactive PHP REPL and debugger. PsySH versions before 0.11.23 and between 0.12.0 and 0.12.19 automatically load and execute a .psysh.php configuration file from the current working directory (CWD) upon startup. This behavior introduces a security risk if an attacker can write a malicious .psysh.php file into a directory that a victim, especially a privileged user, later uses as their CWD when launching PsySH. Because the file is executed in the context of the user running PsySH, this can lead to arbitrary code execution and local privilege escalation if the user has elevated privileges (e.g., root, CI runners, or operations/debug accounts). The vulnerability extends to downstream consumers embedding PsySH, such as Laravel's Tinker console (invoked via php artisan tinker), which inherits the same risk. Exploitation requires the attacker to have write access to a directory that the victim will use as their CWD and for the victim to launch PsySH or Tinker from that directory, thus requiring local access and user interaction. The vulnerability is mitigated by upgrading PsySH to versions 0.11.23 or 0.12.19, which remove the automatic loading of .psysh.php from the CWD. The CVSS 3.1 score is 6.7 (medium), reflecting the local attack vector, required privileges, and user interaction, but high impact on confidentiality, integrity, and availability. No known exploits have been reported in the wild as of the publication date.
Potential Impact
For European organizations, this vulnerability poses a significant risk primarily in environments where PsySH or downstream tools like Laravel Tinker are used by privileged users. Development, operations, and continuous integration environments that run PHP applications and use PsySH for debugging or interactive shell access are at risk. If an attacker gains local write access to directories used by these users, they can escalate privileges, potentially compromising sensitive systems or data. This could lead to unauthorized access to critical infrastructure, data leakage, or disruption of services. Organizations with automated deployment pipelines or shared development environments are particularly vulnerable if directory permissions are not tightly controlled. The impact is heightened in sectors with strict data protection requirements, such as finance, healthcare, and government, where privilege escalation could lead to regulatory non-compliance and reputational damage.
Mitigation Recommendations
European organizations should immediately upgrade PsySH to versions 0.11.23 or 0.12.19 or later to eliminate the automatic loading of .psysh.php from the CWD. Review and restrict directory permissions to prevent untrusted users from writing files into directories that privileged users might use as their CWD. Implement policies to avoid launching PsySH or Laravel Tinker from untrusted or writable directories, especially when running with elevated privileges. Employ monitoring to detect unexpected .psysh.php files in commonly used directories. In CI/CD environments, isolate build and debug environments to prevent directory poisoning. Educate developers and operations staff about the risks of running interactive shells in attacker-writable directories. Consider using containerization or sandboxing to limit the impact of potential local exploits. Regularly audit and update PHP development tools and dependencies to incorporate security patches promptly.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-01-29T14:03:42.540Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 697d1444ac06320222789620
Added to database: 1/30/2026, 8:27:48 PM
Last enriched: 2/7/2026, 8:37:16 AM
Last updated: 3/26/2026, 4:16:10 AM
Views: 144
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.