Executive brief
Pi, a terminal-based coding tool, contains a security flaw in how it handles temporary extension packages. On shared Linux systems, a malicious user could place a fraudulent package in a predictable temporary folder before a victim attempts to install an extension. If successful, the attacker can run their own code with the victim's permissions, potentially leading to data theft or full system access.
Technical details
Pi (versions 0.74.0 to 0.78.1) is vulnerable to a local privilege escalation/code execution flaw (CWE-379) due to the use of predictable paths in the shared system temporary directory (e.g., `os.tmpdir()/pi-extensions`). On multi-user Linux systems, an attacker with local access can pre-create these directories with malicious extension code. When a victim user subsequently runs Pi to install a temporary extension from npm or git, the application may load and execute the attacker's code within the victim's process context. The vulnerability is mitigated in version 0.78.1 by moving the extension cache to a private, user-specific directory (`~/.pi/agent/tmp/extensions`) with restricted (0700) permissions.
Affected products
- earendil-works Pi >= 0.74.0, < 0.78.1
Timeline
- 2026-06-02: patched: Fixes committed to repository
- 2026-06-23: disclosed: CVE published to NVD
References
- https://github.com/earendil-works/pi/commit/a98e087e5d08ea2a536bf73dbb0aebb87c3ef72e
- https://github.com/earendil-works/pi/commit/ea3465a8e371a12d0167a06b60f93878e3a3df44
- https://github.com/earendil-works/pi/pull/5345
- https://github.com/earendil-works/pi/releases/tag/v0.78.1
- https://github.com/earendil-works/pi/security/advisories/GHSA-jfgx-wxx8-mp94