Summary
@budibase/server: Command Injection in PostgreSQL Dump Command
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 "
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
}
Impact
- Remote code execution
- System compromise
- Data exfiltration
Untrusted input is inserted into a command that is later executed by the application, allowing the attacker to alter the intent of that command. Typical impact: arbitrary command execution in the application's environment.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
- Use environment variables for sensitive values instead of command-line arguments
- Validate and sanitize all configuration values
- Use proper escaping for shell arguments
- Consider using a PostgreSQL library's native dump functionality instead of shell commands
Frequently Asked Questions
- What is CVE-2026-25041? CVE-2026-25041 is a high-severity command injection vulnerability in @budibase/server (npm), affecting versions < 3.23.32. It is fixed in 3.23.32. Untrusted input is inserted into a command that is later executed by the application, allowing the attacker to alter the intent of that command.
- Which versions of @budibase/server are affected by CVE-2026-25041? @budibase/server (npm) versions < 3.23.32 is affected.
- Is there a fix for CVE-2026-25041? Yes. CVE-2026-25041 is fixed in 3.23.32. Upgrade to this version or later.
- Is CVE-2026-25041 exploitable, and should I be worried? Whether CVE-2026-25041 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-25041 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-25041? Upgrade
@budibase/serverto 3.23.32 or later.