CVE-2026-54327: Pi Agent Race Condition Vulnerability

LOW
Advisory Identifier: GHSA-r95r-rj6r-c39x
CVSS 2.2
CWE-367 CWE-732
Published
Advisory Summary

CVE-2026-54327 is a LOW (CVSS 2.2) race condition vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Pi Agent libraries in the npm ecosystem. The issue involves race condition in pi auth.json writes could expose stored credentials. Remediation is available by upgrading affected packages to version 0.78.1.

CVE-2026-54327 at a Glance

CVE Identifier CVE-2026-54327
GHSA Identifier GHSA-r95r-rj6r-c39x
Severity LOW
CVSS v3.1 Base Score 2.2
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Pi Agent
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 2.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N).

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

How to Fix CVE-2026-54327

To remediate this vulnerability, upgrade all affected Pi Agent dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@mariozechner/pi-coding-agent fixed: Latest secure release
npm install @mariozechner/pi-coding-agent@Latest secure release
@earendil-works/pi-coding-agent fixed: 0.78.1
npm install @earendil-works/pi-coding-agent@0.78.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @mariozechner/pi-coding-agent

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-54327, inspect your project dependencies using npm:

npm ls @mariozechner/pi-coding-agent

Analyze the terminal output to locate any version of Pi Agent in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.78.1), your application is affected.

Note: The npm ls @mariozechner/pi-coding-agent command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Pi Agent, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# 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.

CVE-2026-54327 Affected Pi Agent Versions

2 component(s)
Fixed Versions:
0.78.1
Product / Package Ecosystem Affected Versions Fixed Version
@mariozechner/pi-coding-agent
npm
≥ 0.28.0
≤ 0.73.1
@earendil-works/pi-coding-agent
npm
≥ 0.74.0
< 0.78.1
0.78.1

References

Frequently Asked Questions

What is CVE-2026-54327?
CVE-2026-54327 is a security vulnerability in Pi Agent involving Race condition in Pi auth.json writes could expose stored credentials under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Pi Agent versions are affected?
Affected versions include releases prior to 0.78.1 across affected packages: @mariozechner/pi-coding-agent, @earendil-works/pi-coding-agent.
What version fixes CVE-2026-54327?
Upgrading to 0.78.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @mariozechner/pi-coding-agent affected?
Yes, @mariozechner/pi-coding-agent is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is @earendil-works/pi-coding-agent affected?
Yes, @earendil-works/pi-coding-agent is affected in releases prior to 0.78.1. Upgrade your dependency to 0.78.1 or later.
What is the CVSS score of CVE-2026-54327?
CVE-2026-54327 has a CVSS v3.1 base score of 2.2 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-54327?
CVE-2026-54327 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check npm dependencies for CVE-2026-54327?
Run the dependency tree command: 'npm ls @mariozechner/pi-coding-agent'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r95r-rj6r-c39x",
  "modified" : "2026-07-20T21:12:58Z",
  "published" : "2026-06-17T13:54:37Z",
  "aliases" : [ "CVE-2026-54327" ],
  "summary" : "Pi Agent: Race condition in Pi auth.json writes could expose stored credentials",
  "details" : "# 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@mariozechner/pi-coding-agent"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.28.0"
      }, {
        "last_affected" : "0.73.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@earendil-works/pi-coding-agent"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.74.0"
      }, {
        "fixed" : "0.78.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/earendil-works/pi/security/advisories/GHSA-r95r-rj6r-c39x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54327"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/earendil-works/pi/commit/135fb545f99106a4a249274f129b90bc0a77d347"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/earendil-works/pi"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/earendil-works/pi/releases/tag/v0.78.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367", "CWE-732" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-17T13:54:37Z",
    "nvd_published_at" : "2026-06-23T20:16:49Z"
  }
}