CVE-2016-1247
High · 7.8CVSS
7.8
EPSS
4.9%
Published
Nov 29, 2016
CISA due date
—
Cloudanix analysis
A problem in the nginx web server lets someone with limited access take over the whole computer by using a link to trick it into changing important system files.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Privilege Escalation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Allows local users with access to the nginx web server account to escalate privileges to root via a symlink attack on the configured error log file.
Why it matters to the business
Attackers who already have limited access on affected systems can gain full root control, enabling data theft, persistence, or further compromise across nginx deployments that have remained unpatched for years.
How an attack unfolds
An attacker with access to the nginx user account identifies the error log path, replaces it with a symlink to a root-owned file such as a cron job or shadow file, triggers a write operation through an error condition, and leverages the resulting file modification to execute code as root.
How to fix it
Upgrade nginx packages on all affected distributions to versions that eliminate the symlink vulnerability in error log handling.
How to confirm the fix worked
Confirm nginx is running a patched release, verify that error log paths cannot be replaced with symlinks by non-root users, and audit file creation permissions under the nginx account.
Typical attack path
- Obtain access as the nginx web server user account
- Locate the configured error log file path
- Replace the log path with a symlink pointing to a privileged target file
- Induce an error that forces nginx to write to the log
- Abuse the overwritten privileged file to achieve root execution
How to detect it
Review nginx error log directories and system audit logs for symlink creations or ownership changes performed by the nginx user account, and look for subsequent root-level processes or file modifications originating from that account.
What your security team should do
- Prioritize patching all nginx instances to current fixed releases
- Restrict the nginx service account to the minimum required permissions
- Enable filesystem protections such as immutable flags on critical log directories
- Scan systems for unexpected symlinks created by the nginx user
The record
The nginx package before 1.6.2-5+deb8u3 on Debian jessie, the nginx packages before 1.4.6-1ubuntu3.6 on Ubuntu 14.04 LTS, before 1.10.0-0ubuntu0.16.04.3 on Ubuntu 16.04 LTS, and before 1.10.1-0ubuntu1.1 on Ubuntu 16.10, and the nginx ebuild before 1.10.2-r3 on Gentoo allow local users with access to the web server user account to gain root privileges via a symlink attack on the error log.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | nginx | 0 | 1.10.2-1 |
| Debian:12 | nginx | 0 | 1.10.2-1 |
| Debian:13 | nginx | 0 | 1.10.2-1 |
| Debian:8 | nginx | 0 | 1.6.2-5+deb8u3 |
| Ubuntu:14.04:LTS | nginx | 0 | 1.4.6-1ubuntu3.6 |
| Ubuntu:16.04:LTS | nginx | 0 | 1.10.0-0ubuntu0.16.04.3 |
Related vulnerabilities
- CVE-2017-7529 Nginx versions since 0.5.6 up to and including 1.13.2 are vulnerable to integer overflow… Also affects nginx
- CVE-2016-4450 os/unix/ngx_files.c in nginx before 1.10.1 and 1.11.x before 1.11.1 allows remote… Also affects nginx
- CVE-2016-0742 The resolver in nginx before 1.8.1 and 1.9.x before 1.9.10 allows remote attackers to… Also affects nginx
- CVE-2014-3616 nginx 0.5.6 through 1.7.4, when using the same shared ssl_session_cache or… Also affects nginx
- CVE-2013-4547 nginx 0.8.41 through 1.4.3 and 1.5.x before 1.5.7 allows remote attackers to bypass… Also affects nginx
- CVE-2013-2070 http/modules/ngx_http_proxy_module.c in nginx 1.1.4 through 1.2.8 and 1.3.0 through… Also affects nginx
- CVE-2012-1180 Use-after-free vulnerability in nginx before 1.0.14 and 1.1.x before 1.1.17 allows remote… Also affects nginx
- CVE-2009-4487 nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which… Also affects nginx