Open-Source Security Intelligence

Know every vulnerability
before it knows you.

DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.

Search

GHSA-726g-59wr-cj4c

HighCVSS 8.6 / 10
Published Mar 9, 2026·Last modified Mar 10, 2026
Affected Components(0)

No affected components available

Description

Location: packages/server/src/integrations/postgres.ts:529-531

Description

The PostgreSQL integration constructs shell commands using user-controlled configuration values (database name, host, password, etc.) without proper sanitization. The password and other connection parameters are directly interpolated into a shell command.

Code Reference

    const dumpCommand = `PGPASSWORD="${
      this.config.password
    }" pg_dump --schema-only "${dumpCommandParts.join(" ")}"`

Attack Vector

An attacker who can control database configuration values (e.g., through compromised credentials or configuration injection) can inject shell commands. For example:

  • Password: password"; malicious-command; echo "
  • Database name: db"; rm -rf /; echo "

Impact

  • Remote code execution
  • System compromise
  • Data exfiltration

Recommendation

  1. Use environment variables for sensitive values instead of command-line arguments
  2. Validate and sanitize all configuration values
  3. Use proper escaping for shell arguments
  4. Consider using a PostgreSQL library's native dump functionality instead of shell commands

Example Fix

import { execFile } from "child_process"
import { promisify } from "util"
const execFileAsync = promisify(execFile)

// Use execFile with proper argument handling
const env = {
  ...process.env,
  PGPASSWORD: this.config.password
}

const args = [
  "--schema-only",
  "--host", this.config.host,
  "--port", this.config.port.toString(),
  "--username", this.config.user,
  "--dbname", this.config.database
]

try {
  const { stdout } = await execFileAsync("pg_dump", args, { env })
  return stdout
} catch (error) {
  // Handle error
}
Risk Scores
Base Score
8.6

The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs high-level or administrative privileges. No user interaction is needed for the attacker to exploit this vulnerability.

Threat Intelligence
6.1

Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.

EPSS
0.48%

The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.

Exploit
Not available

We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.

Browse More

Scan your project

Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.

Checkout DevGuard