Skip to main content

Pi Coding Agent EUVDEUVD-2026-38580

| CVE-2026-54328 HIGH
Creation of Temporary File in Directory with Insecure Permissions (CWE-379)
2026-06-17 https://github.com/earendil-works/pi GHSA-jfgx-wxx8-mp94
7.3
CVSS 3.1 · Vendor: https://github.com/earendil-works/pi
Share

Severity by source

Vendor (https://github.com/earendil-works/pi) PRIMARY
7.3 HIGH
AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
vuln.today AI
7.3 HIGH

Local attacker with unprivileged shell on shared host (AV:L, PR:L), trivial path pre-staging (AC:L), but needs victim to invoke pi with matching extension source (UI:R); full code execution as victim yields C/I/A:H.

3.1 AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/earendil-works/pi).

CVSS VectorVendor: https://github.com/earendil-works/pi

CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
Source Code Evidence Fetched
Jun 17, 2026 - 14:20 vuln.today
Analysis Generated
Jun 17, 2026 - 14:20 vuln.today
CVE Published
Jun 17, 2026 - 13:55 github-advisory
HIGH 7.3

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 31 npm packages depend on @earendil-works/pi-coding-agent (31 direct, 0 indirect)
  • 1 npm packages depend on @mariozechner/pi-coding-agent (1 direct, 0 indirect)

Ecosystem-wide dependent count for version 0.74.0 and other introduced versions.

DescriptionCVE.org

Predictable temporary extension install paths allow local privilege escalation on shared Linux hosts

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.

Info

The vulnerable code path affected temporary extension package sources loaded with --extension or -e, specifically npm and git package sources. The temporary npm install root and temporary git clone paths were deterministic and rooted under os.tmpdir()/pi-extensions. The path was derived from public source information rather than from a per-user private directory or an unpredictable temporary directory.

During resource resolution, pi considered an npm package or git checkout present if the expected package path already existed. Extension resources discovered from that package location were then loaded by the extension loader. Because extensions execute with the same privileges as the invoking pi process, pre-created temporary package contents could execute as the victim user.

The issue primarily affects Linux-based multi-user hosts where the operating system temporary directory is shared across user accounts, such as shared development machines, CI runners, HPC login nodes, and similar environments. On Windows and macOS, the default temporary directory is typically user-scoped, so default configurations are not expected to be affected unless the temporary directory is overridden to a shared writable location.

Impact

A local attacker with access to the same host can exploit this only if a victim runs a vulnerable pi version with a temporary npm or git extension package source that maps to the attacker-prepared location. No network attack path is involved and no race must be won, but victim interaction is required.

Successful exploitation can allow arbitrary extension code execution as the victim user. This can expose or modify files accessible to that user and can also cause denial of service or data loss through malicious package contents or unsafe temporary cache entries.

Affected versions

  • @earendil-works/pi-coding-agent: affected >= 0.74.0, < 0.78.1; patched >= 0.78.1
  • @mariozechner/pi-coding-agent: affected >= 0.50.0, <= 0.73.1; no patched version was released under the old package name. Migrate to @earendil-works/pi-coding-agent >= 0.78.1.

The solution

Version 0.78.1 moves temporary extension package installs to a private per-user directory under ~/.pi/agent/tmp/extensions and enforces 0700 permissions on that directory. The same release also hardens git package source path handling so managed clone paths remain inside their intended install roots.

Recommendations

Upgrade to @earendil-works/pi-coding-agent version 0.78.1 or later. Users of the deprecated @mariozechner/pi-coding-agent package should migrate to the @earendil-works/pi-coding-agent package and upgrade to a fixed version.

On shared Linux hosts, avoid using temporary npm or git extension package sources with vulnerable versions. Review any third-party extensions before loading them, because pi extensions run with full access to the invoking user's account.

Workarounds

If upgrading immediately is not possible, avoid --extension or -e with npm or git package sources on shared Linux systems. As an additional mitigation for vulnerable versions, configure the process temporary directory environment to point at a directory owned by the invoking user with 0700 permissions before starting pi.

Timeline

  • 2026-05-29: Report received
  • 2026-06-02: Fix committed
  • 2026-06-04: Fixed version 0.78.1 released
  • 2026-06-08: Advisory prepared for publication

Credits

Reported by Paul Urian and Cosmin Alexa of CrowdStrike.

AnalysisAI

Local privilege escalation in the Pi coding agent (npm packages @earendil-works/pi-coding-agent 0.74.0-0.78.0 and @mariozechner/pi-coding-agent 0.50.0-0.73.1) allows a co-resident attacker on a shared Linux host to pre-stage attacker-controlled extension code in a predictable os.tmpdir()/pi-extensions path that pi later loads as the victim user. No public exploit identified at time of analysis, but the issue was reported by CrowdStrike researchers and patched in 0.78.1 of the renamed package. Affects shared dev boxes, CI runners, and HPC login nodes; Windows/macOS default per-user temp directories typically avoid exposure.

Technical ContextAI

Pi is a Node.js-based coding agent that supports loading extensions on-demand via --extension/-e from npm or git package sources. The package manager (packages/coding-agent/src/core/package-manager.ts) computed a deterministic install root under os.tmpdir()/pi-extensions derived purely from public source identifiers (npm spec, or git-<host> plus a sha256 hash of the host+path), and treated the package as already installed whenever that path existed on disk. On Linux, os.tmpdir() resolves to the world-writable /tmp (mode 1777) shared across all local accounts, so any user could mkdir the future path with their own contents and rely on pi's existsSync-gated short-circuit to skip the real install. This is a textbook CWE-379 (creation of temporary file in directory with insecure permissions) issue, here applied to a directory tree used as a code-loading cache. The fix introduces getExtensionTempFolder rooted at ~/.pi/agent/tmp/extensions with explicit mkdirSync({mode: 0o700}) plus chmodSync(0o700), and also hardens git clone path containment within the managed install root.

RemediationAI

Vendor-released patch: @earendil-works/pi-coding-agent 0.78.1 - upgrade via npm i -g @earendil-works/pi-coding-agent@^0.78.1 (or pin in your package manifest). Users still on the deprecated @mariozechner/pi-coding-agent package must migrate to @earendil-works/pi-coding-agent >= 0.78.1, as no fix was issued under the old name. See the advisory at https://github.com/earendil-works/pi/security/advisories/GHSA-jfgx-wxx8-mp94 and the fix PR https://github.com/earendil-works/pi/pull/5345 (commits a98e087 and ea3465a) plus release https://github.com/earendil-works/pi/releases/tag/v0.78.1. If immediate upgrade is not possible, the vendor-recommended workarounds are to avoid --extension/-e with npm or git sources on shared Linux hosts (trade-off: loses the temporary extension-install convenience), and/or set TMPDIR to a private directory you own with 0700 permissions before launching pi (trade-off: must be set in every shell/CI job that runs pi, and any process that inherits this env var will share the constrained temp dir). Always review third-party extensions before loading, since pi extensions execute with the invoking user's full privileges.

Share

EUVD-2026-38580 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy