CVE-2016-1255
High · 7.8CVSS
7.8
EPSS
0.4%
Published
Dec 5, 2017
CISA due date
—
Cloudanix analysis
A local user on certain Debian and Ubuntu servers running PostgreSQL could trick a management script into overwriting important system files, giving the attacker full control of the machine.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Low
- Impact
- Privilege Gain
- Component
- Application
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The pg_ctlcluster script follows symlinks when writing to logfiles in /var/log/postgresql without validation, allowing a local user to redirect output to arbitrary files and thereby overwrite privileged content.
Why it matters to the business
Local attackers on affected Debian and Ubuntu systems can obtain full root access, leading to complete compromise of database servers, data theft, service disruption, and potential lateral movement within the environment.
How an attack unfolds
An attacker with local access creates a symlink from the postgresql logfile path to a sensitive target such as /etc/passwd or a cron script, then triggers pg_ctlcluster so the script writes attacker-controlled content through the link, achieving root privilege escalation.
How to fix it
Upgrade postgresql-common to a fixed version: Debian wheezy to 134wheezy5 or later, jessie to 165+deb8u2 or later, unstable to 178 or later; Ubuntu 12.04 to 129ubuntu1.2 or later, 14.04 to 154ubuntu1.1 or later, 16.04 to 173ubuntu0.1 or later, 17.04 to 179ubuntu0.1 or later, 17.10 to 184ubuntu1.1 or later. Restrict write access to /var/log/postgresql until patches are applied.
How to confirm the fix worked
Confirm the installed postgresql-common package version meets or exceeds the listed fixed releases for the distribution, then test that pg_ctlcluster operations no longer follow symlinks into protected directories.
Typical attack path
- Obtain local shell access on a vulnerable system
- Create a symlink from /var/log/postgresql/*.log to a privileged target file
- Invoke pg_ctlcluster or wait for a scheduled cluster operation
- Verify the target file has been overwritten with attacker data
- Escalate to root via the modified privileged file
How to detect it
Review system logs and file integrity data for unexpected modifications to files in /etc, /root, or cron directories around the time pg_ctlcluster or postgresql service restarts occurred; inspect /var/log/postgresql for symlinks created by non-root users.
- /var/log/postgresql/*.log -> /etc/passwd
- /var/log/postgresql/*.log -> /etc/shadow
- pg_ctlcluster process writing through symlink
- Unexpected changes to /etc/cron.d or /root/.bashrc coinciding with postgresql logs
What your security team should do
- Immediately patch postgresql-common on all Debian and Ubuntu systems to the fixed package versions
- Audit local user accounts and remove unnecessary sudo or postgres group memberships
- Monitor /var/log/postgresql for unexpected symlink creations or permission changes
- Harden logfile directory permissions to prevent symlink planting by non-root users
The record
The pg_ctlcluster script in postgresql-common package in Debian wheezy before 134wheezy5, in Debian jessie before 165+deb8u2, in Debian unstable before 178, in Ubuntu 12.04 LTS before 129ubuntu1.2, in Ubuntu 14.04 LTS before 154ubuntu1.1, in Ubuntu 16.04 LTS before 173ubuntu0.1, in Ubuntu 17.04 before 179ubuntu0.1, and in Ubuntu 17.10 before 184ubuntu1.1 allows local users to gain root privileges via a symlink attack on a logfile in /var/log/postgresql.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | postgresql-common | 0 | 178 |
| Debian:12 | postgresql-common | 0 | 178 |
| Debian:13 | postgresql-common | 0 | 178 |
| Debian:7 | postgresql-common | 0 | 134wheezy5 |
| Ubuntu:14.04:LTS | postgresql-common | 0 | 154ubuntu1.1 |
| Ubuntu:16.04:LTS | postgresql-common | 0 | 173ubuntu0.1 |
Related vulnerabilities
- CVE-2026-113724 virtualenv is a tool for creating isolated virtual python environments. CWE-59
- CVE-2026-113716 virtualenv is a tool for creating isolated virtual python environments. CWE-59
- CVE-2026-55480 OpenPrinting CUPS is an open source printing system for Linux and other Unix-like… CWE-59
- CVE-2026-90954 A flaw was found in BusyBox's dpkg-deb archive extraction. CWE-59
- CVE-2026-109274 ImageMagick before 7.1.2-32 contains a time-of-check time-of-use symlink race… CWE-59
- CVE-2026-105081 ImageMagick before 6.9.13-58 and 7.x before 7.1.2-33 does not properly account for… CWE-59
- CVE-2026-108119 A flaw was found in busybox. CWE-59
- CVE-2026-12345 The cleanup of tempfile.TemporaryDirectory is vulnerable to a race condition. CWE-59