CVE-2026-145348 - repmgr OS command injection through node record values in remote SSH commands

First Published: 2026/12/04

Last Updated: 2026/12/04

Summary

repmgr does not quote values from node records before it adds them to 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 (config_file) 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.

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-145348

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 configuration file path and host name from node records before it adds them to an ssh command, and passes the remote command to ssh as a single argument.

ProductVRMFRemediation/First Fix
repmgr4.0.0 through 5.5.1Update 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.conf so that user can connect only from them.
  • Checking config_file and the host in conninfo in repmgr.nodes for unexpected values before running repmgr cluster matrix, repmgr cluster crosscheck or repmgr standby switchover.

References

Acknowledgement

Source: Reported to EDB by Zachariah Mithani of AploSec 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.


Could this page be better? Report a problem or suggest an addition!