/

CVE-2026-48017

Severity:

HIGH RISK

(8.8)

Code Injection (CWE-94) in DbGate load-reader Endpoint

CVE-2026-48017

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

DbGate's /runners/load-reader endpoint allows an authenticated user to inject arbitrary JavaScript code into a server-side template via the functionName parameter.

When exploited, this flaw can lead to arbitrary code execution with the full privileges of the Node.js process, enabling command execution, file access, and access to connected databases in deployments where the vulnerable endpoint is exposed.

Affected context

The vulnerability appears in DbGate deployments that expose the /runners/load-reader HTTP endpoint and allow authenticated users with basic access to call it.

The risk is present when the server directly interpolates user-provided function names into JavaScript code templates on the backend without validation, while running the Node.js process with access to the host filesystem and stored database connection credentials.

Containerized or Docker-based deployments may limit system-wide impact, but can still suffer full compromise within the container and unauthorized access to databases reachable from DbGate.

Exploit preconditions

  • Attack surface: HTTP API endpoint POST /runners/load-reader on the DbGate server.
  • Required access: Valid authenticated DbGate user account with basic privileges; no administrative role or shell-execution permissions needed.
  • Trigger point: Supplying a crafted functionName value that is interpolated into JavaScript code and executed server-side.
  • Why exploitation is possible: The application builds and evaluates JavaScript code using untrusted input without sanitization, validation, or robust sandboxing, allowing the injected code to escape the intended require = null restriction and execute with full process privileges.

Why this happens

This issue stems from constructing executable JavaScript code by directly embedding user-controlled data into a server-side template and then evaluating it.

Rather than treating functionName as a simple identifier and validating it against a known set of safe values, the backend logic allows arbitrary content to be inserted into a code string, which is then executed by the Node.js engine.

This behavior aligns with CWE-94: Improper Control of Generation of Code ('Code Injection'), where dynamically generated code is influenced by untrusted input, bypassing intended sandbox limitations and enabling arbitrary script execution.

Potential impact

  • Execute arbitrary OS commands with the privileges of the DbGate Node.js process.
  • Read, modify, or delete files accessible to the DbGate server process.
  • Retrieve and abuse stored database connection credentials, then access or manipulate connected databases.
  • Pivot into other systems reachable from the DbGate environment, including internal databases and services.
  • Fully compromise Docker or container environments at the level of the application container, often equivalent to root within that container.
  • Disrupt availability of the DbGate service or corrupt hosted data.

General mitigation guidance

Effective mitigation involves treating all input that influences code generation as untrusted and avoiding dynamic evaluation patterns where possible.

Common defensive strategies include:

  • Replacing dynamic code generation with static, predefined functions selected from a whitelist of allowed operations.
  • Strictly validating parameters like functionName against an allowlist of safe identifiers, rejecting any unexpected values.
  • Avoiding eval, Function, or similar runtime code-compilation mechanisms on server-side request data.
  • Implementing strong sandboxing for any required scripting, including explicit API exposure, restricted globals, and separation of untrusted code from core application privileges.
  • Running DbGate with least-privilege OS accounts, constrained filesystem permissions, and hardened container settings to reduce blast radius if code execution occurs.

How teams detect issues like this

Organizations can look for this class of vulnerability using a combination of code inspection and automated scanning:

  • Static analysis: Rules that flag use of eval, new Function, dynamic vm contexts, or string-based code construction where untrusted input contributes to the code body.
  • Code review: Manual checks for endpoints where parameters are interpolated into JavaScript templates, particularly around "runner", "scripting", or "plugin" features.
  • Security testing: Targeted dynamic tests that send crafted functionName values to the /runners/load-reader endpoint and observe unusual server behavior, errors, or execution traces.
  • Policy enforcement: CI/CD checks and linters that prohibit unsafe code generation patterns or require explicit security review for any server-side scripting features.

Sources

SourceLink
github.comgithub.com/dbgate/dbgate/releases/tag/v7.1.9
github.comgithub.com/dbgate/dbgate/security/advisories/GHSA-hv83-ggc4-v385

Frequently asked

questions

Yes, if the DbGate web interface or API is reachable over the network and an attacker can obtain valid credentials, they can exploit the vulnerable endpoint remotely.

No. The described issue can be exploited by any authenticated user with basic access; no admin role or explicit shell-execution permissions are required.

The most robust fix is to remove dynamic code generation based on user input and instead implement a whitelist of predefined server-side functions, ensuring user-controlled parameters never form part of executable code.

Avoid server-side eval-style constructs, enforce strict validation and allowlists for any parameter that influences logic, perform regular security code reviews for scripting features, and use static analysis tools that detect dynamic evaluation patterns.

Find out what's already
exploitable in your codebase.