{"id":"CVE-2026-54327","aliases":["CVE-2026-54327","GHSA-r95r-rj6r-c39x"],"related":[],"kind":"vulnerability","state":"published","title":"Pi: Race condition in auth.json writes could expose stored credentials","summary":"Pi is a minimal terminal coding harness. From 0.74.0 until 0.78.1, 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. This vulnerability is fixed in 0.78.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Pi is a minimal terminal coding harness. From 0.74.0 until 0.78.1, 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. This vulnerability is fixed in 0.78.1.","source":"cvelist"},{"lang":"en","text":"# Pi auth.json writes could briefly expose stored credentials to local users\n\nPi 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.\n\n## Info\n\nThe 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.\n\nThe 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`.\n\n## Impact\n\nExploitation 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.\n\nThis is not remotely exploitable by itself.\n\n## Affected versions\n\n- Affected: `@mariozechner/pi-coding-agent >= 0.28.0, <= 0.73.1`\n- Affected: `@earendil-works/pi-coding-agent >= 0.74.0, < 0.78.1`\n- Patched: `@earendil-works/pi-coding-agent >= 0.78.1`\n\n## The solution\n\nVersion 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.\n\n## Recommendations\n\nUpgrade 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.\n\nAfter 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.\n\n## Workarounds\n\nIf 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.\n\n## Timeline\n\n- 2026-05-29: Report received\n- 2026-06-02: Fix committed\n- 2026-06-04: Fixed version released\n- 2026-06-08: Advisory published\n\n## Credits\n\nReported by Paul Urian and Cosmin Alexa of CrowdStrike.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Pi es un arnés de codificación de terminal mínimo. Desde la versión 0.74.0 hasta la 0.78.1, Pi almacenaba claves de API y credenciales de OAuth en auth.json. Una condición de carrera en la ruta de escritura del archivo podría crear o reescribir brevemente este archivo con permisos derivados del umask del proceso antes de restringir el archivo a permisos de solo propietario. Esta vulnerabilidad está corregida en la versión 0.78.1.","source":"nvd"}],"published":"2026-06-17T13:54:37.000Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N","score":2.2,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N","score":2.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N","score":2.2,"rating":"LOW"}],"cwes":["CWE-367","CWE-732"],"affected":[{"ranges":[{"version":">= 0.74.0, < 0.78.1","status":"affected"}],"vendor":"earendil-works","product":"pi","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.28.0","status":"affected","lastAffected":"0.73.1"}],"ecosystem":"npm","package":"@mariozechner/pi-coding-agent","purl":"pkg:npm/%40mariozechner/pi-coding-agent","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.74.0","status":"affected","fixed":"0.78.1"}],"ecosystem":"npm","package":"@earendil-works/pi-coding-agent","purl":"pkg:npm/%40earendil-works/pi-coding-agent","source":"ghsa"}],"references":[{"url":"https://github.com/earendil-works/pi/security/advisories/GHSA-r95r-rj6r-c39x","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/earendil-works/pi/commit/135fb545f99106a4a249274f129b90bc0a77d347","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/earendil-works/pi/releases/tag/v0.78.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54327","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/earendil-works/pi","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-26T18:09:06.999Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-54327","url":"https://www.cve.org/CVERecord?id=CVE-2026-54327","licence":"CVE Terms of Use","modified":"2026-06-26T18:09:58.763Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-r95r-rj6r-c39x","url":"https://github.com/advisories/GHSA-r95r-rj6r-c39x","licence":"CC-BY-4.0","modified":"2026-07-20T21:30:42.044Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-54327","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54327","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"}],"updatedAt":"2026-11-25T22:59:25.531Z","epss":{"score":0.00074,"percentile":0.00087,"date":"2026-12-01T12:00:22.000Z"}}