Skip to main content

Pi Coding Agent EUVDEUVD-2026-38582

| CVE-2026-54327 LOW
Time-of-check Time-of-use (TOCTOU) Race Condition (CWE-367)
2026-06-17 https://github.com/earendil-works/pi GHSA-r95r-rj6r-c39x
2.2
CVSS 3.1 · Vendor: https://github.com/earendil-works/pi
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain local shell account on target system
  2. Delivery
    Confirm victim's ~/.pi/agent directory is traversable
  3. Exploit
    Monitor directory for auth.json write event via inotify or polling
  4. Execution
    Race to open auth.json before permission tightening completes
  5. Persist
    Read API keys or OAuth tokens from file
  6. Impact
    Authenticate to victim's third-party provider accounts

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture TOCTOU prevention
Exploitation Conditions

All of the following conditions must hold simultaneously: (1) the attacker has a local shell account on the same machine as the victim; (2) the victim's Pi agent configuration directory (~/.pi/agent or equivalent) is traversable by the attacker - i.e., not restricted to owner-only permissions; (3) the attacker successfully times a file read to the brief window between auth.json creation and the permission-tightening operation, classified AC:H in the CVSS vector; and (4) the victim must trigger a credential write during the attack window (UI:R) - this occurs on initial auth setup, credential saves, or OAuth token refresh. The vulnerability is explicitly not remotely exploitable by itself (AV:L). Users whose home directory or ~/.pi/agent directory is private (mode 700 or stricter) are substantially protected, as the attacker cannot traverse the directory to reach auth.json. The @mariozechner/pi-coding-agent package has no fix available, making migration the only complete remediation for those users.

Impact

The vendor CVSS 3.1 score of 2.2 (AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N) is independently validated and accurately reflects real-world risk. Attack vector is strictly local, complexity is High due to race timing requirements, the attacker needs at minimum low-privilege shell access plus directory traverse rights, and user interaction is required because the victim must trigger a credential write. No EPSS data was supplied, and there is no CISA KEV listing. No public POC exists at time of analysis. Despite the low CVSS score, the business impact of stolen provider credentials - API keys and OAuth tokens granting access to third-party accounts - may be disproportionate relative to the base score on shared multi-user systems where ~/.pi/agent has permissive directory permissions. For single-user workstations or systems with owner-only home directories, risk is negligible. The gap between the 2.2 base score and potential credential-theft impact should be weighed for multi-user server deployments.

Exploit ScenarioDerived

A local attacker on a shared multi-user system identifies a victim whose ~/.pi/agent directory is world-traversable. The attacker uses inotifywait or a tight polling loop to detect when auth.json is created or rewritten - for example, during an OAuth token refresh triggered by the victim's normal use of Pi - and immediately opens the file in the brief window before permissions are tightened to 0600. If the race is won, the attacker reads API keys or OAuth tokens and uses them to authenticate to the victim's configured provider accounts. No public proof-of-concept code is known; reliably winning the race would require timing tooling and may demand repeated attempts given the High AC classification.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 17, 2026

Credential disclosure in Pi coding agent affects all versions of @mariozechner/pi-coding-agent (>=0.28.0, <=0.73.1) and @earendil-works/pi-coding-agent (>=0.74.0, <0.78.1) due to a TOCTOU race condition in auth.json file writes. The credential storage code wrote auth.json with umask-inherited permissions and only subsequently tightened the mode to owner-only, leaving a brief window in which a local user with directory traverse access could read API keys, OAuth access tokens, and OAuth refresh tokens. This is not remotely exploitable; no public exploit identified at time of analysis, and the vendor CVSS of 2.2 reflects the strict local and timing prerequisites.

RemediationAI

Vendor-released patch: @earendil-works/pi-coding-agent 0.78.1. Upgrade to @earendil-works/pi-coding-agent version 0.78.1 or later via npm; this release atomically creates auth.json with mode 0600 at open time, eliminating the race window. Users still on the deprecated @mariozechner/pi-coding-agent package must migrate entirely to @earendil-works/pi-coding-agent and install 0.78.1 or later, as no patch will be issued for the legacy package. After upgrading on any multi-user system where ~/.pi/agent was readable by other local users, rotate all configured provider API keys and OAuth tokens immediately, as prior credential exposure cannot be ruled out. If immediate upgrade is not possible, apply three interim controls: restrict the ~/.pi/agent directory to owner-only permissions (chmod 700 ~/.pi/agent) to prevent directory traversal by other local users; manually restrict auth.json to mode 0600 (chmod 600 ~/.pi/agent/auth.json); and launch Pi with a restrictive umask (umask 077) to reduce the creation-mode window. Note that the umask workaround is non-atomic and does not fully close the race - directory restriction is the most effective compensating control. Advisory: https://github.com/earendil-works/pi/security/advisories/GHSA-r95r-rj6r-c39x.

Affected VersionsENISA

pi 0.74.0, < 0.78.1

Affected Packages

npm @earendil-works/pi-coding-agent fix: 0.78.1
npm @mariozechner/pi-coding-agent no fix
euvd pi_0_74_0 fix: 0.78.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in npm, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The root cause is CWE-367 (Time-of-Check Time-of-Use race condition) in the credential storage backend of the Pi coding agent, implemented in packages/coding-agent/src/core/auth-storage.ts. The affected code called Node.js writeFileSync without specifying a file creation mode, causing auth.json to inherit permissions from the process umask - potentially world-readable - before a separate chmod-equivalent operation corrected it to 0600. The fix introduced a shared constant AUTH_FILE_WRITE_OPTIONS = { encoding: 'utf-8', mode: 0o600 } applied atomically at open time across all three writeFileSync call sites, eliminating the race window entirely. Both affected npm packages (pkg:npm/@mariozechner_pi-coding-agent and pkg:npm/@earendil-works_pi-coding-agent) share the same vulnerable code lineage, as the latter is a continuation of the former from version 0.74.0 onward.

Know when Crowdstrike gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

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

Local-only attack vector, High complexity from race timing window, Low privileges for directory traversal, Restricted confidentiality to stored credential file contents only.

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

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

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

Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

DescriptionCVE.org

Pi auth.json writes could briefly expose stored credentials to local users

Pi stored API keys and OAuth credentials in auth.json. A race condition in the file write path could briefly create or rewrite this file with permissions derived from the process umask before tightening the file to owner-only permissions.

Info

The affected credential storage code wrote auth.json and then corrected the file mode in a separate operation. During the interval between those operations, a local user who could read and traverse the Pi agent configuration directory could potentially read the file before its permissions were restricted.

The file can contain API keys, OAuth access tokens, and OAuth refresh tokens for configured providers. The affected behavior was present in the original auth.json credential storage implementation and thus affects both the original @mariozechner/pi-coding-agent package as well as @earendil-works/pi-coding-agent.

Impact

Exploitation requires local access to the same machine and read/traverse access to the victim's Pi agent configuration directory. Users whose ~/.pi/agent directory is private to their account are less exposed. The main impact is disclosure of stored provider credentials, which may allow use of the configured provider accounts according to the privileges of those credentials.

This is not remotely exploitable by itself.

Affected versions

  • Affected: @mariozechner/pi-coding-agent >= 0.28.0, <= 0.73.1
  • Affected: @earendil-works/pi-coding-agent >= 0.74.0, < 0.78.1
  • Patched: @earendil-works/pi-coding-agent >= 0.78.1

The solution

Version 0.78.1 changed the credential storage writes to create auth.json with mode 0600 at open time. The fix applies to initial file creation and credential save paths, including OAuth token refresh writes.

Recommendations

Upgrade to @earendil-works/pi-coding-agent version 0.78.1 or later. Users still on the deprecated @mariozechner/pi-coding-agent package should migrate to the @earendil-works/pi-coding-agent package and install version 0.78.1 or later.

After upgrading, rotate any credentials that may have been exposed on multi-user systems where the Pi agent configuration directory was readable by other local users.

Workarounds

If upgrading immediately is not possible, restrict the Pi agent configuration directory so only the owning user can traverse it, restrict auth.json to owner-only permissions, and run Pi with a restrictive umask such as 077 until the upgrade is complete.

Timeline

  • 2026-05-29: Report received
  • 2026-06-02: Fix committed
  • 2026-06-04: Fixed version released
  • 2026-06-08: Advisory published

Credits

Reported by Paul Urian and Cosmin Alexa of CrowdStrike.

Threat Intelligence Overview

EPSS Score
0.1%
Top 100% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Low

Priority Score

11
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +11
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2026-40050 CRITICAL
9.8 Apr 21

Unauthenticated path traversal in CrowdStrike LogScale cluster API allows remote attackers to read arbitrary files from

CVE-2026-103056 CRITICAL
9.4 Sep 30

Command injection in the AiSOC actions service (AiSOC 7.2.0 up to, but excluding, 12.0.0) allows a low-privileged authen

CVE-2026-40058 HIGH
8.8 Sep 15

Local privilege escalation in the CrowdStrike Falcon sensor for Windows occurs when the Microsoft Office File Malicious

CVE-2026-54328 HIGH
7.3 Jun 17

Local privilege escalation in the Pi coding agent (npm packages @earendil-works/pi-coding-agent 0.74.0-0.78.0 and @mario

CVE-2022-2841 LOW POC
2.7 Aug 22

A vulnerability was found in CrowdStrike Falcon 6.31.14505.0/6.42.15610/6.44.15806. Rated low severity (CVSS 2.7), this

CVE-2025-42706 MEDIUM
6.5 Oct 08

Arbitrary file deletion in the CrowdStrike Falcon sensor for Windows (versions before 7.24) requires an attacker to alre

CVE-2025-42701 MEDIUM
5.6 Oct 08

Arbitrary file deletion in the CrowdStrike Falcon sensor for Windows (versions below 7.24) is possible when an attacker

CVE-2025-37728 MEDIUM
5.4 Oct 07

Credential disclosure in Elastic Kibana's Crowdstrike connector lets an authenticated user who can create and run connec

CVE-2026-76380 MEDIUM
4.3 Aug 19

Cleartext exposure of document passwords in the CrowdStrike OAuth API app for Splunk SOAR (versions below 5.1.3) allows

CVE-2026-54326 LOW
2.5 Jun 16

Stored XSS in the HTML session export feature of pi-coding-agent allows script execution in an exported document when a

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