{"id":"CVE-2026-145347","state":"PUBLISHED","title":"repmgr OS command injection through node record values in pg_basebackup and pg_rewind commands","description":"repmgr 4.0.0 through 5.5.1 is affected by an OS command injection vulnerability (CWE-78) in the pg_basebackup and pg_rewind commands it builds. During repmgr standby clone, the replication user name (repluser) from the upstream node's record in the repmgr.nodes table is inserted into the pg_basebackup command line without escaping. During repmgr node rejoin with --force-rewind, including the rejoin step of repmgr standby switchover --force-rewind, the primary node's connection string (conninfo) is inserted into the pg_rewind command line without escaping. repmgr runs both commands through the shell. An attacker with the credentials of a non-superuser repmgr database user can write a crafted node record and run OS commands, as the operating system user that runs repmgr (usually postgres), on the node being cloned or rejoined. Deployments whose repmgr database user is a superuser gain no new capability, because a superuser can already run OS commands. The issue is fixed in repmgr 5.5.2.","publishedAt":"2026-12-04T21:17:37.050Z","updatedAt":"2026-12-04T21:17:37.050Z","severity":{"score":5.9,"label":"Medium","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:P/VC:L/VI:H/VA:H/SC:N/SI:N/SA:N","source":"EDB"},"assigner":"EDB","products":["EnterpriseDB repmgr"],"affected":[{"vendor":"EnterpriseDB","product":"repmgr","defaultStatus":"unaffected","versions":[{"version":"4.0.0","status":"affected","lessThan":"5.5.2","versionType":"custom"}],"repo":"https://github.com/EnterpriseDB/repmgr","programFiles":["repmgr-action-standby.c","repmgr-action-node.c"]}],"references":["https://www.enterprisedb.com/docs/security/advisories/cve2026145347/","https://github.com/EnterpriseDB/repmgr/releases/tag/v5.5.2"],"weaknesses":["CWE-78"],"ingestedAt":"2026-12-04T21:28:05.875Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/145xxx/CVE-2026-145347.json","commit":"49319ebcd33101c5354c688f7d8b6059f08a200e","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-145347","state":"PUBLISHED","datePublished":"2026-12-04T21:17:37.050Z","dateUpdated":"2026-12-04T21:17:37.050Z","assignerShortName":"EDB","assignerOrgId":"20be33e2-bf35-4d13-8fad-18bd2f3e3659","dateReserved":"2026-12-04T19:48:23.702Z"},"containers":{"cna":{"title":"repmgr OS command injection through node record values in pg_basebackup and pg_rewind commands","descriptions":[{"lang":"en","value":"repmgr 4.0.0 through 5.5.1 is affected by an OS command injection vulnerability (CWE-78) in the pg_basebackup and pg_rewind commands it builds. During repmgr standby clone, the replication user name (repluser) from the upstream node's record in the repmgr.nodes table is inserted into the pg_basebackup command line without escaping. During repmgr node rejoin with --force-rewind, including the rejoin step of repmgr standby switchover --force-rewind, the primary node's connection string (conninfo) is inserted into the pg_rewind command line without escaping. repmgr runs both commands through the shell. An attacker with the credentials of a non-superuser repmgr database user can write a crafted node record and run OS commands, as the operating system user that runs repmgr (usually postgres), on the node being cloned or rejoined. Deployments whose repmgr database user is a superuser gain no new capability, because a superuser can already run OS commands. The issue is fixed in repmgr 5.5.2."}],"affected":[{"vendor":"EnterpriseDB","product":"repmgr","defaultStatus":"unaffected","versions":[{"version":"4.0.0","status":"affected","lessThan":"5.5.2","versionType":"custom"}],"repo":"https://github.com/EnterpriseDB/repmgr","programFiles":["repmgr-action-standby.c","repmgr-action-node.c"]}],"references":[{"url":"https://www.enterprisedb.com/docs/security/advisories/cve2026145347/"},{"url":"https://github.com/EnterpriseDB/repmgr/releases/tag/v5.5.2"}],"metrics":[{"format":"CVSS","cvssV4_0":{"version":"4.0","vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:P/VC:L/VI:H/VA:H/SC:N/SI:N/SA:N","baseScore":5.9,"baseSeverity":"MEDIUM"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-78","lang":"en","description":"CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')","type":"CWE"}]}],"providerMetadata":{"shortName":"EDB","orgId":"20be33e2-bf35-4d13-8fad-18bd2f3e3659","dateUpdated":"2026-12-04T21:17:37.050Z"},"source":{"discovery":"EXTERNAL"},"credits":[{"lang":"en","value":"Wandi Malyoga Hutajulu","type":"finder"}],"x_generator":{"engine":"cvelib 1.8.0"}}}}}