Skip to main content
Vulnerability Database/CVE-2026-104587

CVE-2026-104587: blob42 gosuki Stored XSS Vulnerability

CVE-2026-104587 is a stored cross-site scripting flaw in blob42 gosuki that allows attackers to execute arbitrary JavaScript through malicious bookmark URLs. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-104587 Overview

CVE-2026-104587 is a Stored Cross-Site Scripting (XSS) vulnerability in blob42 gosuki, a bookmark management application written in Go. The flaw affects all versions through commit 6e2bf34. The application renders bookmark data using Go's text/template package instead of html/template, which bypasses context-aware auto-escaping. Attackers can inject malicious payloads into the URL and DisplayURL fields of bookmarks within internal/webui/templates/bookmarks.html. When a victim loads the local web interface, the injected JavaScript executes in their browser context.

Critical Impact

Attackers who can add or modify bookmarks can execute arbitrary JavaScript in the victim's browser session, enabling session theft, local interface abuse, and client-side attacks.

Affected Products

  • blob42 gosuki bookmark manager
  • All builds through commit 6e2bf34
  • The web UI component at internal/webui/templates/bookmarks.html

Discovery Timeline

  • 2026-10-13 - CVE-2026-104587 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2026-104587

Vulnerability Analysis

The vulnerability resides in the local web interface used to browse stored bookmarks. The template engine processes bookmark fields without HTML-aware escaping. An attacker injects a bookmark URL containing attribute-breaking characters such as quotes or angle brackets. When the template renders the bookmark, the injected content escapes its intended HTML attribute context and introduces executable script content. The payload runs with full access to the local web UI's origin, including any session cookies, local storage, and in-page actions available to the user.

Root Cause

The root cause is incorrect template package selection in Go. The text/template package performs no HTML escaping and treats all string substitutions as raw text. The html/template package would apply context-aware escaping based on where each value appears (HTML body, attribute, URL, JavaScript). By using text/template to render HTML, the developer removed the primary defense against injected markup. This maps to [CWE-79] Improper Neutralization of Input During Web Page Generation.

Attack Vector

An attacker crafts a bookmark whose URL field contains an attribute-breaking payload, for example a value that terminates the surrounding attribute quote and introduces an event handler such as onerror or onmouseover. The malicious bookmark can be delivered through any import path gosuki supports, including browser bookmark synchronization or direct database manipulation. When the victim opens the local web UI and the bookmark list renders, the browser parses and executes the attacker-controlled JavaScript.

Technical details for the proof of concept are available in the GitHub PoC Repository. The upstream source is maintained in the gosuki GitHub Project Repository.

Detection Methods for CVE-2026-104587

Indicators of Compromise

  • Bookmark entries whose URL or DisplayURL fields contain HTML control characters such as ", <, >, or event handler attributes like onerror= and onload=.
  • Browser console errors or unexpected network requests originating from the gosuki local web UI pages.
  • Modifications to bookmark storage from untrusted browser profiles or import sources.

Detection Strategies

  • Scan bookmark data stores for URL fields that fail strict URL parsing or contain embedded HTML syntax.
  • Inspect rendered pages from the gosuki web UI for script content that was not shipped with the application.
  • Review git history and build artifacts to confirm whether the deployed binary uses text/template or html/template for bookmark rendering.

Monitoring Recommendations

  • Log and alert on bookmark import events from external browsers or third-party sources.
  • Monitor outbound requests from the host running gosuki for unexpected domains that could indicate data exfiltration from an XSS payload.
  • Track process execution and child processes spawned from the browser used to access the gosuki UI.

How to Mitigate CVE-2026-104587

Immediate Actions Required

  • Stop exposing the gosuki web interface on any network interface beyond localhost until a patched build is deployed.
  • Audit the current bookmark database and remove entries containing suspicious URL characters or embedded HTML.
  • Rebuild gosuki from source with the template rendering code changed from text/template to html/template.

Patch Information

No official vendor patch is referenced in the NVD entry at the time of publication. Users should monitor the gosuki GitHub Project Repository for an upstream fix that replaces text/template with html/template in internal/webui/templates/bookmarks.html and applies output encoding to the URL and DisplayURL fields.

Workarounds

  • Restrict access to the local web UI by binding only to the loopback interface and enforcing host firewall rules.
  • Disable automatic bookmark import from untrusted browser profiles or shared sync accounts.
  • Pre-validate bookmark URLs with a strict parser that rejects any value containing HTML control characters before writing to the gosuki database.
bash
# Example: block non-loopback access to the gosuki web UI with iptables
sudo iptables -A INPUT -p tcp --dport 4444 ! -i lo -j DROP

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.