First Published: 2026/12/04
Last Updated: 2026/12/04
Summary
repmgr does not escape values from node records before it adds them to the pg_basebackup and pg_rewind commands it runs through the shell. 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 --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.
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.
The issue is a privilege escalation only in deployments where the repmgr database user is not a superuser. When it is a superuser, as in the repmgr quick start and in clusters deployed with Trusted Postgres Architect, the attacker gains no new capability, because a superuser can already run OS commands. Upgrading is still recommended.
This is a different code path from CVE-2026-122043, which repmgr 5.5.1 fixed. repmgr 5.5.1 is affected by this issue.
Vulnerability details
CVE-ID: CVE-2026-145347
CVSS Base Score: 5.9 Medium
CVSS Temporal Score: Undefined
CVSS Environmental Score: Undefined
CVSS 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
Affected products and versions
- Affected Product: repmgr
- Affected Versions: repmgr 4.0.0 through 5.5.1
Remediation/fixes
Impacted users must upgrade to a fixed version of repmgr. Starting with repmgr 5.5.2, repmgr quotes the replication user name and connection string from node records before it adds them to the pg_basebackup and pg_rewind commands.
| Product | VRMF | Remediation/First Fix |
|---|---|---|
| repmgr | 4.0.0 through 5.5.1 | Update to repmgr 5.5.2 or later |
Mitigation
Until you can upgrade, reduce exposure by:
- Restricting the repmgr database user's credentials to the cluster hosts, and restricting
pg_hba.confso that user can connect only from them. - Checking
repluserandconninfoinrepmgr.nodesfor unexpected values before runningrepmgr standby cloneorrepmgr node rejoin --force-rewind.
References
- CVSS Calculator v4.0
- CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
- repmgr 5.5.2 release
Related information
Acknowledgement
Source: Reported to EDB by Wandi Malyoga Hutajulu through the EDB Vulnerability Disclosure Program.
Change history
- 2026/12/04: Original Copy Published
Disclaimer
This document is provided on an "as is" basis and does not imply any kind of guarantee or warranty, including the warranties of merchantability or fitness for a particular use. Your use of the information on the document is at your own risk. EDB reserves the right to change or update this document at any time. Customers are therefore recommended to always view the latest version of this document.