CVE Vulnerabilities

CVE-2017-12172

Improper Link Resolution Before File Access ('Link Following')

Published: Nov 22, 2017 | Modified: Oct 09, 2019
CVSS 3.x
6.7
MEDIUM
Source:
NVD
CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
7.2 HIGH
AV:L/AC:L/Au:N/C:C/I:C/A:C
RedHat/V2
RedHat/V3
Ubuntu

PostgreSQL 10.x before 10.1, 9.6.x before 9.6.6, 9.5.x before 9.5.10, 9.4.x before 9.4.15, 9.3.x before 9.3.20, and 9.2.x before 9.2.24 runs under a non-root operating system account, and database superusers have effective ability to run arbitrary code under that system account. PostgreSQL provides a script for starting the database server during system boot. Packages of PostgreSQL for many operating systems provide their own, packager-authored startup implementations. Several implementations use a log file name that the database superuser can replace with a symbolic link. As root, they open(), chmod() and/or chown() this log file name. This often suffices for the database superuser to escalate to root privileges when root starts the server.

Weakness

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

Affected Software

Name Vendor Start Version End Version
Postgresql Postgresql 9.2 (including) 9.2 (including)
Postgresql Postgresql 9.2.1 (including) 9.2.1 (including)
Postgresql Postgresql 9.2.2 (including) 9.2.2 (including)
Postgresql Postgresql 9.2.3 (including) 9.2.3 (including)
Postgresql Postgresql 9.2.4 (including) 9.2.4 (including)
Postgresql Postgresql 9.2.5 (including) 9.2.5 (including)
Postgresql Postgresql 9.2.6 (including) 9.2.6 (including)
Postgresql Postgresql 9.2.7 (including) 9.2.7 (including)
Postgresql Postgresql 9.2.8 (including) 9.2.8 (including)
Postgresql Postgresql 9.2.9 (including) 9.2.9 (including)
Postgresql Postgresql 9.2.10 (including) 9.2.10 (including)
Postgresql Postgresql 9.2.11 (including) 9.2.11 (including)
Postgresql Postgresql 9.2.12 (including) 9.2.12 (including)
Postgresql Postgresql 9.2.13 (including) 9.2.13 (including)
Postgresql Postgresql 9.2.14 (including) 9.2.14 (including)
Postgresql Postgresql 9.2.15 (including) 9.2.15 (including)
Postgresql Postgresql 9.2.16 (including) 9.2.16 (including)
Postgresql Postgresql 9.2.17 (including) 9.2.17 (including)
Postgresql Postgresql 9.2.18 (including) 9.2.18 (including)
Postgresql Postgresql 9.2.19 (including) 9.2.19 (including)
Postgresql Postgresql 9.2.20 (including) 9.2.20 (including)
Postgresql Postgresql 9.2.21 (including) 9.2.21 (including)
Postgresql Postgresql 9.2.22 (including) 9.2.22 (including)
Postgresql Postgresql 9.2.23 (including) 9.2.23 (including)
Postgresql Postgresql 9.3 (including) 9.3 (including)
Postgresql Postgresql 9.3.1 (including) 9.3.1 (including)
Postgresql Postgresql 9.3.2 (including) 9.3.2 (including)
Postgresql Postgresql 9.3.3 (including) 9.3.3 (including)
Postgresql Postgresql 9.3.4 (including) 9.3.4 (including)
Postgresql Postgresql 9.3.5 (including) 9.3.5 (including)
Postgresql Postgresql 9.3.6 (including) 9.3.6 (including)
Postgresql Postgresql 9.3.7 (including) 9.3.7 (including)
Postgresql Postgresql 9.3.8 (including) 9.3.8 (including)
Postgresql Postgresql 9.3.9 (including) 9.3.9 (including)
Postgresql Postgresql 9.3.10 (including) 9.3.10 (including)
Postgresql Postgresql 9.3.11 (including) 9.3.11 (including)
Postgresql Postgresql 9.3.12 (including) 9.3.12 (including)
Postgresql Postgresql 9.3.13 (including) 9.3.13 (including)
Postgresql Postgresql 9.3.14 (including) 9.3.14 (including)
Postgresql Postgresql 9.3.15 (including) 9.3.15 (including)
Postgresql Postgresql 9.3.16 (including) 9.3.16 (including)
Postgresql Postgresql 9.3.17 (including) 9.3.17 (including)
Postgresql Postgresql 9.3.18 (including) 9.3.18 (including)
Postgresql Postgresql 9.3.19 (including) 9.3.19 (including)
Postgresql Postgresql 9.4 (including) 9.4 (including)
Postgresql Postgresql 9.4.1 (including) 9.4.1 (including)
Postgresql Postgresql 9.4.2 (including) 9.4.2 (including)
Postgresql Postgresql 9.4.3 (including) 9.4.3 (including)
Postgresql Postgresql 9.4.4 (including) 9.4.4 (including)
Postgresql Postgresql 9.4.5 (including) 9.4.5 (including)
Postgresql Postgresql 9.4.6 (including) 9.4.6 (including)
Postgresql Postgresql 9.4.7 (including) 9.4.7 (including)
Postgresql Postgresql 9.4.8 (including) 9.4.8 (including)
Postgresql Postgresql 9.4.9 (including) 9.4.9 (including)
Postgresql Postgresql 9.4.10 (including) 9.4.10 (including)
Postgresql Postgresql 9.4.11 (including) 9.4.11 (including)
Postgresql Postgresql 9.4.12 (including) 9.4.12 (including)
Postgresql Postgresql 9.4.13 (including) 9.4.13 (including)
Postgresql Postgresql 9.4.14 (including) 9.4.14 (including)
Postgresql Postgresql 9.5 (including) 9.5 (including)
Postgresql Postgresql 9.5.1 (including) 9.5.1 (including)
Postgresql Postgresql 9.5.2 (including) 9.5.2 (including)
Postgresql Postgresql 9.5.3 (including) 9.5.3 (including)
Postgresql Postgresql 9.5.4 (including) 9.5.4 (including)
Postgresql Postgresql 9.5.5 (including) 9.5.5 (including)
Postgresql Postgresql 9.5.6 (including) 9.5.6 (including)
Postgresql Postgresql 9.5.7 (including) 9.5.7 (including)
Postgresql Postgresql 9.5.8 (including) 9.5.8 (including)
Postgresql Postgresql 9.5.9 (including) 9.5.9 (including)
Postgresql Postgresql 9.6 (including) 9.6 (including)
Postgresql Postgresql 9.6.1 (including) 9.6.1 (including)
Postgresql Postgresql 9.6.2 (including) 9.6.2 (including)
Postgresql Postgresql 9.6.3 (including) 9.6.3 (including)
Postgresql Postgresql 9.6.4 (including) 9.6.4 (including)
Postgresql Postgresql 9.6.5 (including) 9.6.5 (including)
Postgresql Postgresql 10 (including) 10 (including)

Potential Mitigations

  • Follow the principle of least privilege when assigning access rights to entities in a software system.
  • Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References