Pi Agent: Race condition in Pi auth.json writes could expose stored credentials
Date: 2026-06
Affected: npm/@earendil-works/pi-coding-agent, npm/@mariozechner/pi-coding-agent
Attack vector: xss
Category: vulnerability-disclosure
Severity: Low
CVE: CVE-2026-54326
CVE-2026-54327
CWE: CWE-367
CWE-732
CWE-79
CVSS: 2.2 (CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N)

# 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: `@ea


Mitigations:

Architectural layers (MAESTRO):