CVE-2026-34725: dbgate-web Remote Code Execution Vulnerability
HIGHCVE-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
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).
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.
npm install dbgate-web@7.1.5
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
CVE-2026-34725 Affected dbgate-web Versions
1 component(s)| 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?
Which dbgate-web versions are affected?
What version fixes CVE-2026-34725?
Is dbgate-web affected?
What is the CVSS score of CVE-2026-34725?
What CWE is associated with CVE-2026-34725?
How can I check npm dependencies for CVE-2026-34725?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}