Skip to content

dbgate-web: Stored XSS in applicationIcon leads to potential RCE in Electron due to unsafe renderer configuration

High severity GitHub Reviewed Published Apr 1, 2026 in dbgate/dbgate • Updated Apr 6, 2026

Package

npm dbgate-web (npm)

Affected versions

>= 7.0.0, < 7.1.5

Patched versions

7.1.5

Description

Summary

A stored XSS vulnerability exists in DbGate because attacker-controlled SVG icon strings are rendered as raw HTML without sanitization. In the web UI this allows script execution in another user's browser; in the Electron desktop app this can escalate to local code execution because Electron is configured with nodeIntegration: true and contextIsolation: false.

Details

The issue is in the icon rendering path:

  • packages/web/src/icons/FontIcon.svelte
    • treats any icon string starting with <svg as inline SVG
    • renders it with {@html iconValue} without sanitization
  • packages/api/src/controllers/apps.js
    • loads app definitions from disk and returns applicationIcon to clients unchanged
  • packages/web/src/appobj/DatabaseAppObject.svelte
    • passes applicationIcon into additionalIcons
  • packages/web/src/appobj/AppObjectCore.svelte
    • renders those icons through <FontIcon icon={ic.icon}>

This makes applicationIcon a stored XSS sink.

An attacker who can create or modify an app definition can store a payload in applicationIcon. When another user views a matching database/app entry, the payload executes in that user's session.

The impact is especially severe in Electron desktop because:

  • app/src/electron.js
    • nodeIntegration: true
    • contextIsolation: false

With that configuration, JavaScript gained through XSS can access Node/Electron APIs, making local code execution possible.

PoC

This was reproduced by creating an app definition with a malicious applicationIcon and making it match a visible database.

Example payload:

{
  "applicationName": "XSS PoC",
  "applicationIcon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\"><circle cx=\"9\" cy=\"9\" r=\"8\" fill=\"red\"/></svg><img src=x onerror=\"alert('xss-fired')\">",
  "usageRules": [
    {
      "serverHostsList": ["postgres"],
      "databaseNamesList": ["dbgate"]
    }
  ]
}

After saving this app definition and opening the UI where the matching database/app icon is rendered, the JavaScript executes.

RCE In Electron app:

  1. Prepare an attacker-controlled application JSON file with a malicious applicationIcon value.
  2. Set usageRules so the application matches a database the victim is likely to view.
  3. Example payload:
{
  "applicationName": "XSS PoC",
  "applicationIcon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\"><circle cx=\"9\" cy=\"9\" r=\"8\" fill=\"red\"/></svg><img src=x onerror=\"require('fs').writeFileSync(require('path').join(process.cwd(),'xss-rce-poc.txt'),'poc')\">",
  "usageRules": [
    {
      "serverHostsRegex": ".*",
      "databaseNamesRegex": ".*"
    }
  ]
}
  1. Deliver this JSON file to the victim as an application definition file.
  2. The victim imports or saves the file into DbGate's apps storage, for example by opening/creating an application file and saving the attacker-controlled JSON content.
  3. DbGate later loads that app definition through apps/get-all-apps.
  4. When the victim opens a UI view that renders the matching database/application icon, the applicationIcon value is passed into FontIcon.
  5. FontIcon detects that the string starts with <svg and renders it via raw {@html}.
  6. The injected HTML executes in the Electron renderer process.
  7. Because DbGate Desktop uses nodeIntegration: true and contextIsolation: false, the payload can access Node APIs and write the marker file xss-rce-poc.txt

This demonstrates that a malicious saved application JSON file can become stored XSS in the UI and escalate to local code execution in Electron.

Impact

Web app
If an attacker can place a malicious application definition where another user will load it, arbitrary JavaScript executes in the victim's browser session. This can lead to token theft, session hijacking, and performing privileged actions as the victim inside DbGate.

Electron desktop app
In the desktop app, the impact is more severe because the Electron renderer is configured with nodeIntegration: true and contextIsolation: false. If a victim imports or saves a malicious application definition and later opens a UI view that renders the icon, the XSS can access Node/Electron APIs and may result in local code execution on the victim machine.

References

@Stelinkaa Stelinkaa published to dbgate/dbgate Apr 1, 2026
Published to the GitHub Advisory Database Apr 1, 2026
Reviewed Apr 1, 2026
Published by the National Vulnerability Database Apr 2, 2026
Last updated Apr 6, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(6th percentile)

Weaknesses

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. Learn more on MITRE.

Improper Control of Generation of Code ('Code Injection')

The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. Learn more on MITRE.

CVE ID

CVE-2026-34725

GHSA ID

GHSA-35xm-qvjg-8m42

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.