GHSA-35XM-QVJG-8M42

Vulnerability from github – Published: 2026-04-01 22:19 – Updated: 2026-04-06 17:25
VLAI
Summary
dbgate-web: Stored XSS in applicationIcon leads to potential RCE in Electron due to unsafe renderer configuration
Details

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.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "dbgate-web"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "7.0.0"
            },
            {
              "fixed": "7.1.5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-34725"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-01T22:19:57Z",
    "nvd_published_at": "2026-04-02T18:16:33Z",
    "severity": "HIGH"
  },
  "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\u0027s 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 `\u003csvg` 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 `\u003cFontIcon icon={ic.icon}\u003e`\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\u0027s 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\": \"\u003csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"18\\\" height=\\\"18\\\"\u003e\u003ccircle cx=\\\"9\\\" cy=\\\"9\\\" r=\\\"8\\\" fill=\\\"red\\\"/\u003e\u003c/svg\u003e\u003cimg src=x onerror=\\\"alert(\u0027xss-fired\u0027)\\\"\u003e\",\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\": \"\u003csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"18\\\" height=\\\"18\\\"\u003e\u003ccircle cx=\\\"9\\\" cy=\\\"9\\\" r=\\\"8\\\" fill=\\\"red\\\"/\u003e\u003c/svg\u003e\u003cimg src=x onerror=\\\"require(\u0027fs\u0027).writeFileSync(require(\u0027path\u0027).join(process.cwd(),\u0027xss-rce-poc.txt\u0027),\u0027poc\u0027)\\\"\u003e\",\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\u0027s 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 \u003csvg 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\u0027s 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.",
  "id": "GHSA-35xm-qvjg-8m42",
  "modified": "2026-04-06T17:25:15Z",
  "published": "2026-04-01T22:19:57Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "dbgate-web: Stored XSS in applicationIcon leads to potential RCE in Electron due to unsafe renderer configuration"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…