HIGH 7.3

CVE-2026-54328: Pi Terminal Coding Harness Local Privilege Escalation via Insecure Temp File Handling

Pi, a lightweight terminal-based coding environment, contains a privilege escalation vulnerability in versions 0.74.0 through 0.78.0. When Pi installs temporary npm or git extension packages, it uses predictable file paths in the system's shared temporary directory. On multi-user Linux systems, an attacker with local access could place malicious code at these predictable locations before a victim user runs Pi, causing the victim's session to load and execute the attacker's code. This is a local attack requiring both system access and user interaction, but successful exploitation grants the attacker full code execution within the victim's process.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.3 HIGH · CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-379
Affected products
0 configuration(s)
Published / Modified
2026-06-23 / 2026-06-25

NVD description (verbatim)

Pi is a minimal terminal coding harness. From 0.74.0 until 0.78.1, Pi versions with temporary npm or git extension package installs used predictable paths under the operating system temporary directory. On Linux-based multi-user systems, a local attacker who can write to the shared temporary directory could prepare the expected package location before another user runs pi with a temporary extension package source. Pi could then load attacker-controlled extension code in the victim user's process. This vulnerability is fixed in 0.78.1.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from insecure temporary file handling in Pi's extension package installation mechanism (CWE-379: Creation of Temporary File in Directory with Insecure Permissions). When Pi processes temporary extension sources from npm or git, it resolves package paths to predictable locations under /tmp or equivalent directories without proper isolation or permission verification. A local attacker can exploit a race condition or predictable naming scheme by pre-staging malicious package content at the expected path. When the victim user executes Pi with a temporary extension source, the application loads the attacker-controlled extension into the victim's process context, achieving arbitrary code execution with the victim's privileges. The window of vulnerability exists between versions 0.74.0 and 0.78.0; version 0.78.1 addresses this by implementing secure temporary file creation.

Business impact

This vulnerability enables local privilege escalation and code injection on multi-user systems where developers use Pi. An attacker with shell access to a shared development server or workstation can compromise another user's development environment, potentially leading to theft of source code, injection of backdoors into build artifacts, or lateral movement within the organization. The impact is highest in shared development infrastructure or container environments where multiple users operate on the same host. Organizations running Pi on centralized development machines or CI/CD worker pools face elevated risk.

Affected systems

Pi versions 0.74.0 through 0.78.0 are vulnerable on all platforms; the risk is most severe on Linux-based multi-user systems including typical Ubuntu/Debian development servers, shared container environments, and BSD variants. Single-user systems or Windows/macOS deployments with default configurations present lower risk due to stricter temporary directory permissions, though the attack vector remains relevant if these systems have been configured for multi-user access or use shared temporary directories. Any installation where Pi is run by multiple users on the same host should be considered at risk.

Exploitability

Exploitation requires an attacker to already have local access to the target system (AV:L) with low privilege requirements (PR:L). The attack does require user interaction in the form of the victim executing Pi with a temporary extension source (UI:R), which is a plausible real-world scenario for developers testing new extensions or installing temporary tooling. No network component or special exploit code is required—the attacker simply stages files in predictable temporary locations. Overall exploitability is moderate for opportunistic attackers on shared systems; the primary barrier is gaining initial local access and predicting or timing the victim's next Pi invocation.

Remediation

Immediately upgrade Pi to version 0.78.1 or later. Organizations using Pi in multi-user environments should prioritize this patch. During the patching window, mitigations include restricting /tmp and shared temporary directories to single-user access via sticky bits and umask enforcement, disabling temporary extension installations where possible, or isolating Pi execution within containerized environments with per-user temporary directories. However, patching is the definitive remediation.

Patch guidance

Verify that your Pi installation is running version 0.78.1 or later by checking the output of `pi --version` or equivalent. For npm-based installations, update via `npm install -g pi@latest` or `npm update -g pi`. For git-based installs, pull the latest from the repository and rebuild. Test the patched version in a staging environment by running Pi with temporary extension sources to confirm normal operation. Pay particular attention to any CI/CD or shared development servers that invoke Pi automatically.

Detection guidance

Monitor for suspicious file creation in /tmp and equivalent temporary directories, especially around timestamps that correlate with Pi process execution. Look for file modification events in temporary directories by users other than those running Pi. On Linux, use `auditd` rules to log file creation and execution from /tmp. Check process execution logs for Pi invocations that load unexpected modules or extensions. In containerized environments, inspect container layer diffs for unexpected files staged in temporary directories. These detections are useful for identifying active exploitation attempts on patched systems as well.

Why prioritize this

Despite not being on the KEV catalog, this vulnerability merits priority patching because it enables local code execution with a moderate exploitability profile (UI required, but achievable in shared development scenarios) on systems where developers actively handle sensitive code and credentials. The combination of HIGH severity rating, low attack complexity, and relevance to development infrastructure justifies rapid patching in most organizations. Shared development servers and CI/CD worker nodes should be patched within 1–2 weeks; single-user workstations can follow standard patch cadences.

Risk score, explained

The CVSS 3.1 score of 7.3 (HIGH) reflects the high-impact consequences of code execution (confidentiality, integrity, and availability all affected) paired with low attack complexity and modest privilege/interaction requirements. The local attack vector (AV:L) constrains the risk somewhat compared to network-exploitable vulnerabilities, but the unscoped impact (S:U) means the attacker gains full control over the affected user's process without sandbox isolation. This score appropriately ranks the vulnerability as a significant but not critical threat for most organizations.

Frequently asked questions

Does this vulnerability affect Windows or macOS users?

Windows and macOS systems have stricter default permissions on temporary directories, making exploitation significantly less likely. However, if a system has been explicitly configured to allow multi-user write access to shared temporary locations, it could theoretically be vulnerable. Linux-based systems, particularly servers running multiple user accounts, face the highest risk.

Can this be exploited remotely, or is local access absolutely required?

Local access is required. An attacker must have shell access or the ability to write files to the shared temporary directory. This is not a remote code execution vulnerability, and it cannot be triggered over the network. The barrier to exploitation is the need for prior local system compromise or insider access.

If I use Pi only for personal projects and I'm the sole user on my system, do I need to patch immediately?

The risk to single-user systems is minimal, but patching is still recommended for defense-in-depth and to ensure you are protected if your system configuration changes. If your system is ever shared with others or used in a collaborative environment, prioritize the patch.

What should I do if I've detected suspicious activity in /tmp around the time Pi was executed?

Assume the system may have been compromised. Review process execution logs, examine any modifications to Pi extensions or installed packages, audit user credentials and SSH keys, and consider rebuilding the affected system or isolating it for forensic analysis. Contact your incident response team.

This analysis is based on the CVE record published on 2026-06-23 and modified on 2026-06-25. No exploit code or weaponized proof-of-concept details are provided. Patch version numbers and affected version ranges are as stated in the official CVE description; verify against the Pi project advisory before deploying fixes. This explainer does not constitute security advice for your specific environment—conduct your own risk assessment based on system inventory and exposure. KEV status reflects official CISA data as of the analysis date and may change. Source: NVD (public-domain), retrieved 2026-07-29. Analysis generated by SEC.co (claude-haiku-4-5).