Skip to content

Commit ab3b79f

Browse files
1 parent 79ef7b7 commit ab3b79f

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-726g-59wr-cj4c",
4+
"modified": "2026-03-09T16:56:26Z",
5+
"published": "2026-03-09T16:56:26Z",
6+
"aliases": [
7+
"CVE-2026-25041"
8+
],
9+
"summary": "@budibase/server: Command Injection in PostgreSQL Dump Command",
10+
"details": "**Location**: `packages/server/src/integrations/postgres.ts:529-531` \n\n#### Description\nThe 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.\n\n#### Code Reference\n```529:531:packages/server/src/integrations/postgres.ts\n const dumpCommand = `PGPASSWORD=\"${\n this.config.password\n }\" pg_dump --schema-only \"${dumpCommandParts.join(\" \")}\"`\n```\n\n#### Attack Vector\nAn attacker who can control database configuration values (e.g., through compromised credentials or configuration injection) can inject shell commands. For example:\n- Password: `password\"; malicious-command; echo \"`\n- Database name: `db\"; rm -rf /; echo \"`\n\n#### Impact\n- Remote code execution\n- System compromise\n- Data exfiltration\n\n#### Recommendation\n1. Use environment variables for sensitive values instead of command-line arguments\n2. Validate and sanitize all configuration values\n3. Use proper escaping for shell arguments\n4. Consider using a PostgreSQL library's native dump functionality instead of shell commands\n\n#### Example Fix\n```typescript\nimport { execFile } from \"child_process\"\nimport { promisify } from \"util\"\nconst execFileAsync = promisify(execFile)\n\n// Use execFile with proper argument handling\nconst env = {\n ...process.env,\n PGPASSWORD: this.config.password\n}\n\nconst args = [\n \"--schema-only\",\n \"--host\", this.config.host,\n \"--port\", this.config.port.toString(),\n \"--username\", this.config.user,\n \"--dbname\", this.config.database\n]\n\ntry {\n const { stdout } = await execFileAsync(\"pg_dump\", args, { env })\n return stdout\n} catch (error) {\n // Handle error\n}\n```",
11+
"severity": [],
12+
"affected": [
13+
{
14+
"package": {
15+
"ecosystem": "npm",
16+
"name": "@budibase/server"
17+
},
18+
"ranges": [
19+
{
20+
"type": "ECOSYSTEM",
21+
"events": [
22+
{
23+
"introduced": "0"
24+
},
25+
{
26+
"fixed": "3.23.32"
27+
}
28+
]
29+
}
30+
]
31+
}
32+
],
33+
"references": [
34+
{
35+
"type": "WEB",
36+
"url": "https://github.com/Budibase/budibase/security/advisories/GHSA-726g-59wr-cj4c"
37+
},
38+
{
39+
"type": "WEB",
40+
"url": "https://github.com/Budibase/budibase/commit/9fdbff32fb9e69650ba899a799e13f80d9b09e93"
41+
},
42+
{
43+
"type": "PACKAGE",
44+
"url": "https://github.com/Budibase/budibase"
45+
}
46+
],
47+
"database_specific": {
48+
"cwe_ids": [
49+
"CWE-77"
50+
],
51+
"severity": "CRITICAL",
52+
"github_reviewed": true,
53+
"github_reviewed_at": "2026-03-09T16:56:26Z",
54+
"nvd_published_at": null
55+
}
56+
}

0 commit comments

Comments
 (0)