CVE-2026-145347: repmgr OS command injection through node record values in pg_basebackup and pg_rewind commands

Published Dec 4, 2026
·
Updated

repmgr 4.0.0 through 5.5.1 is affected by an OS command injection vulnerability (CWE-78) in the pgbasebackup and pgrewind 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 pgbasebackup 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 pgrewind 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 Software

1 affected component
2ndquadrant repmgr>=4.0.0<=5.5.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 5.5.2

Event History

Dec 4, 2026
CVE Published
via MITRE·09:17 PM
Data Sourced
via MITRE·09:17 PM
DescriptionWeakness

Frequently Asked Questions

1

Which deployments gain a meaningful new attack path from this issue?

Deployments where a non-superuser repmgr database user can modify node records are exposed to privilege escalation onto the operating system account running repmgr, usually postgres. Deployments using a superuser as the repmgr database user gain no new capability because that user can already execute OS commands.

2

What must an attacker be able to do to exploit it?

The attacker needs credentials for a non-superuser repmgr database user and must be able to write a crafted record to the repmgr.nodes table. Exploitation is triggered when a standby clone uses the crafted upstream repluser value, or when a forced rewind rejoin uses the crafted primary conninfo value.

3

Which operational workflows can trigger the injected command?

Standby cloning can trigger injection through the upstream node record's repluser value. Node rejoin with --force-rewind, including repmgr standby switchover --force-rewind, can trigger injection through the primary node record's conninfo value.

4

How can I remediate this issue?

Upgrade to repmgr 5.5.2, which fixes the issue. The affected versions are 4.0.0 through 5.5.1.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203