/

CVE-2026-34725

Severity:

HIGH RISK

(8.2)

Stored XSS in DbGate Web and Electron UI

CVE-2026-34725

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79, CWE-94

Impact:

Session Compromise and Potential Local Code Execution

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

DbGate improperly renders attacker-controlled SVG icon strings as raw HTML without sanitization, enabling stored cross-site scripting (XSS).

In the browser-based UI this can run arbitrary scripts in other users' sessions, and in the Electron desktop app it can escalate further to local code execution due to permissive Electron settings.

Affected context

The vulnerability occurs in DbGate installations (web or Electron) that accept and later display user-supplied SVG icon values in the UI.

When these untrusted SVG strings are inserted directly into the DOM as HTML, scripts embedded in the SVG can execute.

In the web UI, this primarily affects users who view data containing malicious icons.

In the Electron desktop app, the same rendering behavior interacts with nodeIntegration: true and contextIsolation: false, broadening the potential impact from XSS to local code execution capabilities.

Exploit preconditions

  • Attack surface: DbGate UI components that render SVG icons supplied through project configuration, connection metadata, or other user-controlled inputs.
  • Required access: Ability to create, modify, or otherwise influence records or settings that define SVG icon strings (e.g., through a legitimate account, shared workspace, or compromised API/channel).
  • Trigger point: A victim user (or the local user in the desktop app) opens a view or screen where the malicious SVG icon is rendered by the application.
  • Why exploitation is possible: The application treats SVG icon strings as trusted markup and injects them into the DOM without sanitization or content restrictions, enabling script execution within the page or Electron context.

Why this happens

The underlying flaw is a classic stored XSS pattern mapped to CWE-79: Improper Neutralization of Input During Web Page Generation.

DbGate accepts untrusted SVG icon strings and renders them directly as raw HTML/DOM content rather than as inert data.

SVG is an XML-based vector format that can include scriptable elements and event handlers, so treating attacker-controlled SVG as HTML/DOM markup allows arbitrary JavaScript to execute when the icon is displayed.

In the Electron build, this XSS occurs in an environment additionally configured with nodeIntegration: true and contextIsolation: false, effectively bridging the browser context with Node.js APIs and aligning with CWE-94: Improper Control of Generation of Code, since injected script can reach local code execution primitives.

Potential impact

  • Theft of session information or authentication tokens accessible to the DbGate web context.
  • Execution of arbitrary JavaScript in the context of the DbGate UI, potentially manipulating queries, connections, or displayed data.
  • Installation of persistent client-side payloads that trigger whenever affected views or projects are opened.
  • In the Electron app, execution of arbitrary JavaScript with access to Node APIs, which may enable reading/writing local files or spawning processes.
  • Lateral movement within a shared environment, such as influencing other users who open shared configurations or projects.

General mitigation guidance

Mitigation focuses on neutralizing untrusted markup, constraining rendering surfaces, and hardening the runtime environment:

  • Treat all SVG icon strings and display metadata as untrusted input, regardless of source, and apply strict sanitization before inserting into the DOM.
  • Prefer safe rendering primitives such as text-only properties or attribute bindings instead of raw HTML injection (e.g., avoid APIs that bypass the framework's escaping).
  • Apply an allowlist-based SVG sanitizer that strips scripting features (scripts, event handlers, external references, and dangerous elements/attributes) before rendering.
  • Where possible, restrict icons to a controlled set (e.g., predefined icon sets or server-generated identifiers) instead of accepting arbitrary SVG markup from users.
  • In Electron, follow secure-by-default settings: disable nodeIntegration in renderer processes, enable contextIsolation, and avoid exposing broad Node.js APIs directly to web content.
  • Use a principle-of-least-privilege design for any bridge between the UI and the local system, exposing only minimal, validated IPC endpoints.

How teams detect issues like this

Detection strategies typically combine static analysis, code review patterns, and policy enforcement:

  • Use static analysis or linters to flag any code paths that write user-controlled strings into innerHTML, dangerouslySetInnerHTML, or equivalent raw HTML APIs, especially when handling SVG content.
  • During code review, look for places where display metadata (icons, labels, descriptions) is rendered without escaping or sanitization, and for custom HTML injection helpers that bypass framework defaults.
  • Define secure coding guidelines that explicitly forbid direct DOM insertion of untrusted SVG or HTML, backed by automated checks in CI pipelines.
  • For Electron, add configuration checks that assert nodeIntegration: false and contextIsolation: true by default, and monitor for exceptions to this rule.
  • Consider content security policies (for web deployments) that limit inline script execution and unsafe-eval to reduce the blast radius if markup injection occurs.

Sources

SourceLink
github.comgithub.com/dbgate/dbgate/commit/a7d2ed11f3f3d4dfb5d2e4e5467dedafa5fa947e
github.comgithub.com/dbgate/dbgate/releases/tag/v7.1.5
github.comgithub.com/dbgate/dbgate/security/advisories/GHSA-35xm-qvjg-8m42

Frequently asked

questions

Yes. If an attacker can influence data or configuration that supplies SVG icons (for example through a shared database, project, or configuration interface), the payload can be stored and later rendered in other users' browsers or desktop apps.

The attacker needs a way to inject or modify SVG icon strings that the application will later display. This often requires at least a basic user account or indirect write access to underlying data, but does not require direct access to the victim's browser or desktop.

The most robust fix is to eliminate raw HTML rendering of user-controlled icon data: restrict icons to a controlled set or tightly validated format, sanitize any SVG content with an allowlist-based sanitizer, and ensure that rendering uses escaped outputs rather than DOM injection primitives. In Electron, also harden the runtime by disabling Node integration and enabling context isolation.

Design UI components so that untrusted values are always treated as data, not markup; ban direct DOM injection of user-controlled strings; adopt secure defaults in Electron or web frameworks; and enforce these patterns through secure coding standards, automated linting, and code review checklists focused on XSS and rich content rendering risks.

Find out what's already
exploitable in your codebase.