/

CVE-2026-85176

Severity:

HIGH RISK

(8.8)

File Path Traversal (CWE-73) in DbGate jsldata controller

CVE-2026-85176

Deferred

Vulnerability type

Category:

External Control of File Name or Path

CWE:

CWE-73

Impact:

Arbitrary File Read and Write

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 does not adequately validate jslid parameters in the jsldata controller, allowing authenticated users to influence file resolution through the file:// scheme. Under affected deployment conditions, an attacker may read or write arbitrary files, including files containing encrypted database connection credentials.

Affected context

The vulnerability occurs in DbGate deployments where authenticated users can reach the jsldata controller and provide or influence jslid parameters. Risk is increased when getJslFileName() resolves file paths from user-controlled values without reliably enforcing directory containment, allowing file references outside the intended data area.

Exploit preconditions

  • Attack surface: The authenticated jsldata controller
  • Required access: A valid DbGate account or equivalent authenticated session
  • Trigger point: Processing of attacker-influenced jslid parameters by getJslFileName()
  • Why exploitation is possible: File scheme resolution and insufficient path validation may allow references to escape the intended directory boundary
  • Accessible resources: Files readable or writable by the DbGate process, subject to operating-system permissions

Why this happens

The underlying flaw is external control of a file name or path, mapped to CWE-73. The application uses a user-influenced identifier in file resolution without applying a complete, canonicalized containment check and without adequately restricting supported schemes. As a result, an input intended to identify an application-managed file may be interpreted as a path to an unrelated local resource.

Potential impact

  • An authenticated attacker could read sensitive local files
  • Database connection configuration and encrypted credentials could be exposed
  • An attacker could modify application-managed or other writable files
  • Configuration integrity could be weakened
  • File modification could contribute to service disruption or further compromise, depending on process permissions

General mitigation guidance

Mitigation generally focuses on removing user control over filesystem paths and enforcing a narrow, secure file-access model.

Common defensive patterns include:

  • Resolve identifiers through a server-side allowlist rather than treating them as paths
  • Permit only explicitly supported local resources and reject URI schemes such as file:// where unnecessary
  • Canonicalize paths before authorization and enforce containment within a fixed, trusted directory
  • Use strict input validation with bounded formats and reject traversal, absolute paths, and alternate path representations
  • Separate read and write capabilities and apply least-privilege filesystem permissions to the application process
  • Keep connection configuration and credential material outside user-writable locations where possible

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules for user-controlled values passed to file, path, URI, or archive APIs
  • Code review checks for path joins without canonicalization and containment validation
  • Tests covering absolute paths, traversal representations, URI schemes, symbolic links, and platform-specific path formats
  • Runtime logging and alerting for unusual file access outside approved application directories
  • Policy enforcement that restricts filesystem access and prevents application identities from writing sensitive configuration areas

Automated security review tools may help flag path construction and file-access patterns, but findings should be validated against deployment permissions and trust boundaries.

Sources

SourceLink
github.comgithub.com/dbgate/dbgate
github.comgithub.com/dbgate/dbgate/blob/v7.2.6/packages/api/src/controllers/jsldata.js
github.comgithub.com/dbgate/dbgate/blob/v7.2.6/packages/api/src/utility/getJslFileName.js
github.comgithub.com/dbgate/dbgate/issues/1502
vulncheck.comvulncheck.com/advisories/dbgate-through-7.2.6-arbitrary-file-read-and-write-via-file-jslid

Frequently asked

questions

It may be exploitable through a network-accessible DbGate instance when the attacker has authenticated access to the affected controller and the deployment permits the relevant file operations.

The stated condition is authenticated access. The practical impact also depends on which files the DbGate process can read or modify.

Use server-side identifiers mapped to an allowlisted directory, reject unsupported URI schemes, and perform canonicalized containment checks before every file operation.

Minimize user influence over filesystem paths, apply least-privilege service permissions, protect credential configuration, and test file-handling code against traversal and alternate path representations.

Find out what's already
exploitable in your codebase.