CVE-2026-34725: dbgate-web Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-35xm-qvjg-8m42
CVSS 8.2
CWE-94 CWE-79
Published
Advisory Summary

CVE-2026-34725 is a HIGH (CVSS 8.2) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting dbgate-web libraries in the npm ecosystem. The issue involves stored xss in applicationicon leads to potential rce in electron due to unsafe renderer configuration. Remediation is available by upgrading affected packages to version 7.1.5.

CVE-2026-34725 at a Glance

CVE Identifier CVE-2026-34725
GHSA Identifier GHSA-35xm-qvjg-8m42
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product dbgate-web
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.2

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

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-34725

To remediate this vulnerability, upgrade all affected dbgate-web dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

dbgate-web fixed: 7.1.5
npm install dbgate-web@7.1.5
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 dbgate-web

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-34725, inspect your project dependencies using npm:

npm ls dbgate-web

Analyze the terminal output to locate any version of dbgate-web in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.1.5), your application is affected.

Note: The npm ls dbgate-web 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-94: Improper Control of Generation of Code ('Code Injection'), where 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. In dbgate-web, 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

### 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: ```json { "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: ```json { "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": ".*" } ] } ``` 4. Deliver this JSON file to the victim as an application definition file. 5. 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. 6. DbGate later loads that app definition through apps/get-all-apps. 7. When the victim opens a UI view that renders the matching database/application icon, the applicationIcon value is passed into FontIcon. 8. FontIcon detects that the string starts with <svg and renders it via raw {@html}. 9. The injected HTML executes in the Electron renderer process. 10. 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.

CVE-2026-34725 Affected dbgate-web Versions

1 component(s)
Fixed Versions:
7.1.5
Product / Package Ecosystem Affected Versions Fixed Version
dbgate-web
npm
≥ 7.0.0
< 7.1.5
7.1.5

References

Frequently Asked Questions

What is CVE-2026-34725?
CVE-2026-34725 is a security vulnerability in dbgate-web involving Stored XSS in applicationIcon leads to potential RCE in Electron due to unsafe renderer configuration under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which dbgate-web versions are affected?
Affected versions include releases prior to 7.1.5 across affected packages: dbgate-web.
What version fixes CVE-2026-34725?
Upgrading to 7.1.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is dbgate-web affected?
Yes, dbgate-web is affected in releases prior to 7.1.5. Upgrade your dependency to 7.1.5 or later.
What is the CVSS score of CVE-2026-34725?
CVE-2026-34725 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-34725?
CVE-2026-34725 is classified under CWE-94: 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.).
How can I check npm dependencies for CVE-2026-34725?
Run the dependency tree command: 'npm ls dbgate-web'. 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-35xm-qvjg-8m42",
  "modified" : "2026-04-06T17:25:15Z",
  "published" : "2026-04-01T22:19:57Z",
  "aliases" : [ "CVE-2026-34725" ],
  "summary" : "dbgate-web: Stored XSS in applicationIcon leads to potential RCE in Electron due to unsafe renderer configuration",
  "details" : "### Summary\nA 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`.\n\n### Details\nThe issue is in the icon rendering path:\n\n- `packages/web/src/icons/FontIcon.svelte`\n  - treats any icon string starting with `<svg` as inline SVG\n  - renders it with `{@html iconValue}` without sanitization\n- `packages/api/src/controllers/apps.js`\n  - loads app definitions from disk and returns `applicationIcon` to clients unchanged\n- `packages/web/src/appobj/DatabaseAppObject.svelte`\n  - passes `applicationIcon` into `additionalIcons`\n- `packages/web/src/appobj/AppObjectCore.svelte`\n  - renders those icons through `<FontIcon icon={ic.icon}>`\n\nThis makes `applicationIcon` a stored XSS sink.\n\nAn 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.\n\nThe impact is especially severe in Electron desktop because:\n\n- `app/src/electron.js`\n  - `nodeIntegration: true`\n  - `contextIsolation: false`\n\nWith that configuration, JavaScript gained through XSS can access Node/Electron APIs, making local code execution possible.\n\n\n### PoC\nThis was reproduced by creating an app definition with a malicious `applicationIcon` and making it match a visible database.\n\nExample payload:\n\n```json\n{\n  \"applicationName\": \"XSS PoC\",\n  \"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')\\\">\",\n  \"usageRules\": [\n    {\n      \"serverHostsList\": [\"postgres\"],\n      \"databaseNamesList\": [\"dbgate\"]\n    }\n  ]\n}\n```\n\nAfter saving this app definition and opening the UI where the matching database/app icon is rendered, the JavaScript executes.\n\nRCE In Electron app: \n1. Prepare an attacker-controlled application JSON file with a malicious `applicationIcon` value.\n2. Set `usageRules` so the application matches a database the victim is likely to view.\n3. Example payload:\n\n```json\n{\n  \"applicationName\": \"XSS PoC\",\n  \"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')\\\">\",\n  \"usageRules\": [\n    {\n      \"serverHostsRegex\": \".*\",\n      \"databaseNamesRegex\": \".*\"\n    }\n  ]\n}\n```\n\n4. Deliver this JSON file to the victim as an application definition file.\n5. 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.\n6. DbGate later loads that app definition through apps/get-all-apps.\n7. When the victim opens a UI view that renders the matching database/application icon, the applicationIcon value is passed into FontIcon.\n8. FontIcon detects that the string starts with <svg and renders it via raw {@html}.\n9. The injected HTML executes in the Electron renderer process.\n10. Because DbGate Desktop uses nodeIntegration: true and contextIsolation: false, the payload can access Node APIs and write the marker file xss-rce-poc.txt\n\nThis demonstrates that a malicious saved application JSON file can become stored XSS in the UI and escalate to local code execution in Electron.\n\n### Impact\n**Web app**\nIf 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.\n\n**Electron desktop app**\nIn 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "dbgate-web"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.1.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dbgate/dbgate/security/advisories/GHSA-35xm-qvjg-8m42"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34725"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbgate/dbgate/commit/a7d2ed11f3f3d4dfb5d2e4e5467dedafa5fa947e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dbgate/dbgate"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dbgate/dbgate/releases/tag/v7.1.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-01T22:19:57Z",
    "nvd_published_at" : "2026-04-02T18:16:33Z"
  }
}