LOW 2.5

CVE-2026-54326: Pi HTML Export XSS via Control Character Bypass

Pi is a lightweight terminal-based code editor that lets developers export their work sessions as static HTML files for documentation or sharing. Between versions 0.74.0 and 0.78.0, the application failed to properly validate link and image URLs in these exports, allowing potentially harmful URLs to slip through. An attacker could craft a malicious Markdown file that, when exported to HTML, would contain dangerous links—such as those beginning with 'javascript:' or other browser-executable schemes. The flaw exploited a bypass technique: sneaking C0 control characters (invisible, non-printing characters) into the URL scheme to fool the security filter. Browsers automatically clean up these hidden characters before acting on URLs, meaning the malicious intent survives. This is a low-severity issue because it requires local access to the Pi application and user interaction to trigger. It was patched in version 0.78.1.

Source data · NVD / CISA · public domain

CVSS
3.1 · 2.5 LOW · CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
Weaknesses (CWE)
CWE-79
Affected products
0 configuration(s)
Published / Modified
2026-06-23 / 2026-06-25

NVD description (verbatim)

Pi is a minimal terminal coding harness. From 0.74.0 until 0.78.1, Pi HTML exports render session Markdown into a static HTML file. It 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. This vulnerability is fixed in 0.78.1.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-54326 is a stored cross-site scripting (XSS) vulnerability in Pi's HTML export mechanism. The vulnerability stems from inadequate URL scheme validation when rendering Markdown link and image elements into static HTML. Versions 0.74.0 through 0.78.0 implemented a scheme filter but failed to account for C0 control character normalization. An attacker can embed control characters (U+0000 to U+001F) within the scheme portion of a URL—for example, 'java\x00script:alert(1)'—which passes the filter check but is normalized away by the browser during navigation processing, effectively bypassing the intended protection. The vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation). Exploitation requires a victim to open a crafted Markdown file in Pi and export it to HTML, then open the resulting HTML file in a browser where the malicious link is clicked or the image is loaded.

Business impact

For organizations using Pi in development workflows, the practical risk is limited but real. If developers routinely export session notes or code snippets as HTML for documentation or team sharing, a malicious actor with access to the source Markdown (or ability to inject Markdown content) could craft payloads that execute in viewers' browsers when those HTML files are opened. This could lead to theft of session data, browser cookies, or local tokens if the export is opened in an authenticated context. The risk is further constrained by the need for local file access and explicit user action, but it could facilitate social engineering or supply-chain attacks if Pi exports are bundled with public repositories or shared via email. Organizations should inventory Pi deployments in development toolchains and prioritize patching to eliminate the vector, particularly in environments where exported HTML is shared across team boundaries.

Affected systems

Pi versions 0.74.0 through 0.78.0 are affected. The vulnerability does not appear in versions prior to 0.74.0 or in version 0.78.1 and later. Pi is a terminal-based editor, so impact is limited to systems where it is explicitly installed. Developers and DevOps personnel are the primary user base. No other products are impacted by this specific CVE.

Exploitability

Exploitability is low in practical terms. An attacker must first obtain or inject Markdown content into a file that a Pi user will open and export. The attack then depends on the exported HTML being opened in a browser (many users may not do this) and the user interacting with the malicious link or loading a malicious image. The C0 control character bypass is technically straightforward to craft but requires knowledge of the filtering mechanism. There is no evidence of active exploitation or public proof-of-concept code. The vulnerability is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog, confirming no widespread attacks have been reported at the time of publication.

Remediation

Upgrade Pi to version 0.78.1 or later immediately. The patch implements proper URL scheme validation that is resistant to C0 control character bypass attacks. Organizations should verify their Pi installations and ensure developers are running the patched version. If Pi is deployed via a package manager (pip, npm, etc.), update through the standard mechanism. No workarounds exist; patching is the only reliable fix. Consider scanning your repositories and deployment pipelines to confirm version compliance.

Patch guidance

Administrators should instruct all users running Pi versions 0.74.0 to 0.78.0 to upgrade to 0.78.1 or later. For teams using Pi across multiple machines, coordinate the rollout via your standard software deployment process. Verify the installation after upgrade by running 'pi --version' and confirm it reports 0.78.1 or a later release. If Pi is pinned to a specific version in a requirements.txt, setup.py, or package-lock.json, update those dependency files and redeploy. Test the HTML export feature post-upgrade to ensure no regressions in your workflow.

Detection guidance

Identifying affected Pi instances: audit your development environments to determine which machines have Pi installed and note their version numbers. Look for 'pi' in pip freeze, npm list -g, or equivalent package listings. Review usage logs if available to see who exports HTML files and how frequently. If you suspect a malicious Markdown file may have been processed, inspect any exported HTML for suspicious 'javascript:', 'data:', or 'vbscript:' URLs with unusual characters or whitespace. Consider adding a brief security reminder to your development team about validating Markdown sources before opening them in Pi. Automated scanning is limited because the vulnerability is in the export output, not in detecting malicious input.

Why prioritize this

This vulnerability warrants prompt but non-emergency patching. The CVSS score of 2.5 (LOW) reflects the narrow attack surface: local access required, high complexity, user interaction mandatory, and only confidentiality impact. However, the nature of the flaw (stored XSS in exported content) and its applicability to shared HTML artifacts mean it should be addressed within your standard patch cycle—ideally within 30 days. Prioritize teams that actively share Pi-exported HTML files (documentation, code reviews, onboarding materials) and defer slightly for isolated developer machines where exports are rarely shared.

Risk score, explained

The CVSS 3.1 score of 2.5 (LOW) is driven by several constraints: Attack Vector is Local (AV:L), meaning the file must be opened on the victim's machine; Attack Complexity is High (AC:H) due to the need to craft a specific bypass using C0 control characters; Privileges are Not Required (PR:N), but the attacker must control or inject Markdown content; User Interaction is Required (UI:R)—the user must open the file and export it, then click a link or load an image; Scope is Unchanged (S:U); and impact is limited to Confidentiality (C:L) with no integrity or availability impact. The score appropriately reflects a low real-world risk, though the attack is technically feasible for a motivated adversary in scenarios involving shared documentation or collaborative repositories.

Frequently asked questions

Can this vulnerability be exploited remotely or over the network?

No. The vulnerability requires local file access and user action (opening a Markdown file in Pi and exporting it to HTML, then opening that HTML in a browser). There is no network-based attack vector.

What happens if I click a malicious link in the exported HTML?

Depending on the URL scheme (e.g., 'javascript:'), clicking the link could execute arbitrary code in the context of your browser, potentially stealing cookies, session tokens, or sensitive data visible to that browser. The actual impact depends on what sensitive data is accessible and whether the browser has cross-origin protections enabled.

Does updating Pi automatically fix previously exported HTML files?

No. Patching Pi protects you from creating vulnerable HTML exports going forward. Any HTML files exported before upgrading to 0.78.1 will still contain malicious URLs if they were created from compromised Markdown. Review and re-export critical documentation after upgrading if you suspect Markdown was tampered with.

How can I tell if a Markdown file might contain an attack?

Visual inspection is difficult because C0 control characters are invisible. Instead, trust Markdown sources: only open files from trusted colleagues or repositories, and avoid importing Markdown from untrusted or unfamiliar sources. Use file integrity monitoring or review version control diffs if documentation is collaborative.

This analysis is based on the CVE record and publicly available information as of the publication date. No exploit code or weaponized proof-of-concept is provided. Organizations should verify patch availability and compatibility in their environments before deployment. For the most current information, consult the Pi project repository and official security advisories. This intelligence is provided for informational purposes to support security decision-making and should not be construed as legal or compliance advice. Source: NVD (public-domain), retrieved 2026-07-29. Analysis generated by SEC.co (claude-haiku-4-5).