CVE-2026-54326: Pi Agent Cross-Site Scripting Vulnerability

LOW
Advisory Identifier: GHSA-7v5m-pr3q-6453
CVSS 2.5
CWE-79
Published
Advisory Summary

CVE-2026-54326 is a LOW (CVSS 2.5) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Pi Agent libraries in the npm ecosystem. The issue involves potential xss in html session exports via markdown url sanitization bypass. Remediation is available by upgrading affected packages to version 0.78.1.

CVE-2026-54326 at a Glance

CVE Identifier CVE-2026-54326
GHSA Identifier GHSA-7v5m-pr3q-6453
Severity LOW
CVSS v3.1 Base Score 2.5
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Pi Agent
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 2.5

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

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
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-54326

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-54326, 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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

# Potential XSS in HTML session exports via Markdown URL handling Pi HTML exports render session Markdown into a static HTML file. Affected versions did not consistently reject unsafe Markdown link and image URL schemes. In versions with scheme filtering, C0 control characters in the URL scheme could bypass the check because browsers normalize those characters before navigation. ## Impact The realistic attack path is indirect. An attacker would need to get suitable Markdown into a session, for example through prompt injection that causes the model to include an unsafe link, or through other untrusted session content. The user would then need to export the session as HTML, open or share that file, and click the link. If triggered, script runs in the exported document, not in pi or the user's shell. The main risk is limited disclosure of data embedded in that exported session file. ## Affected versions - Affected: `@mariozechner/pi-coding-agent >= 0.27.5, <= 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 old `@mariozechner/pi-coding-agent` package scope has no patched release. It was renamed to `@earendil-works/pi-coding-agent`; users of the old scope should migrate to the new package and upgrade to version 0.78.1 or later. ## Resolution Version 0.78.1 sanitizes Markdown link and image URLs with an allow-list after stripping C0 control characters. ## Recommendations Upgrade `@earendil-works/pi-coding-agent` to version 0.78.1 or later. Regenerate shared HTML exports after upgrading if the underlying sessions contained untrusted content. ## Timeline - 2026-05-29: Report received through GitHub Security Advisories - 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.

CVE-2026-54326 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.27.5
≤ 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-54326?
CVE-2026-54326 is a security vulnerability in Pi Agent involving Potential XSS in HTML session exports via Markdown URL sanitization bypass under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
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-54326?
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-54326?
CVE-2026-54326 has a CVSS v3.1 base score of 2.5 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-54326?
CVE-2026-54326 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-54326?
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-7v5m-pr3q-6453",
  "modified" : "2026-07-20T21:13:19Z",
  "published" : "2026-06-16T23:43:15Z",
  "aliases" : [ "CVE-2026-54326" ],
  "summary" : "Pi Agent: Potential XSS in HTML session exports via Markdown URL sanitization bypass",
  "details" : "# Potential XSS in HTML session exports via Markdown URL handling\n\nPi HTML exports render session Markdown into a static HTML file. Affected versions did not consistently reject unsafe Markdown link and image URL schemes. In versions with scheme filtering, C0 control characters in the URL scheme could bypass the check because browsers normalize those characters before navigation.\n\n## Impact\n\nThe realistic attack path is indirect. An attacker would need to get suitable Markdown into a session, for example through prompt injection that causes the model to include an unsafe link, or through other untrusted session content. The user would then need to export the session as HTML, open or share that file, and click the link.\n\nIf triggered, script runs in the exported document, not in pi or the user's shell. The main risk is limited disclosure of data embedded in that exported session file.\n\n## Affected versions\n\n- Affected: `@mariozechner/pi-coding-agent >= 0.27.5, <= 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\nThe old `@mariozechner/pi-coding-agent` package scope has no patched release. It was renamed to `@earendil-works/pi-coding-agent`; users of the old scope should migrate to the new package and upgrade to version 0.78.1 or later.\n\n## Resolution\n\nVersion 0.78.1 sanitizes Markdown link and image URLs with an allow-list after stripping C0 control characters.\n\n## Recommendations\n\nUpgrade `@earendil-works/pi-coding-agent` to version 0.78.1 or later. Regenerate shared HTML exports after upgrading if the underlying sessions contained untrusted content.\n\n## Timeline\n\n- 2026-05-29: Report received through GitHub Security Advisories\n- 2026-06-02: Fix committed\n- 2026-06-04: Fixed version 0.78.1 released\n- 2026-06-08: Advisory prepared for publication\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:N/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.27.5"
      }, {
        "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-7v5m-pr3q-6453"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54326"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/earendil-works/pi/commit/6cb23f9b5d5b6d1747672f535b167d0d809ac010"
  }, {
    "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-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-16T23:43:15Z",
    "nvd_published_at" : "2026-06-23T20:16:49Z"
  }
}