CVE-2026-145348: repmgr OS command injection through node record values in remote SSH commands
repmgr 4.0.0 through 5.5.1 is affected by an OS command injection vulnerability (CWE-78) in the commands it runs on other cluster nodes over SSH. Commands such as repmgr cluster matrix, repmgr cluster crosscheck and repmgr standby switchover build an ssh command line that includes the configuration file path (configfile) and the host name from other nodes' records in the repmgr.nodes table, and run it through the shell without quoting these values. 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 where an operator or automation runs one of these commands. 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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
repmgrto a version that resolves this vulnerability.Fixed in 5.5.2
Event History
Frequently Asked Questions
Who can exploit this issue, and where does the command execute?
An attacker needs credentials for a non-superuser repmgr database user and must be able to write a crafted record to the repmgr.nodes table. Their command executes as the operating-system user running repmgr, usually postgres, on the node where an operator or automation invokes an affected command.
Which operations can trigger exploitation?
The affected remote SSH command construction is used by repmgr cluster matrix, repmgr cluster crosscheck, and repmgr standby switchover. Exploitation requires an operator or automated process to run one of these commands after the crafted node record has been written.
Are deployments using a superuser repmgr database account exposed to additional risk?
No additional capability is introduced when the repmgr database user is a superuser, because that user can already execute OS commands. The meaningful privilege-escalation scenario is a non-superuser repmgr database user that can write crafted node records.
What should be prioritized if patching cannot happen immediately?
Restrict non-superuser repmgr database users from writing untrusted values into repmgr.nodes, and avoid running the identified cluster and switchover commands against records that may have been modified by untrusted users. Review the config_file and host name values stored in node records before invoking those operations.
What version contains the fix?
The issue is fixed in repmgr 5.5.2. Affected versions are 4.0.0 through 5.5.1.