Cloudanix VulnDB

CVE-2016-1240

High · 7.8

CVSS

7.8

EPSS

9.8%

Published

Oct 3, 2016

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

Users who can already log into certain servers running Tomcat can trick the startup process into giving them complete control of the machine.

Weaponized
Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Low
Impact
Privilege Gain
Component
Application
Class
Improper Input Validation
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The Tomcat init script fails to validate the Catalina log file path, permitting a local user to replace it with a symlink that points to an arbitrary file, resulting in root-owned writes that enable privilege escalation.

Why it matters to the business

Attackers who already have a low-privileged account on affected systems can obtain full root control, leading to complete compromise of the server, data theft, or ransomware deployment; the issue remains relevant on long-lived deployments and requires urgent patching of the listed package.

How an attack unfolds

An attacker with tomcat account access creates a symlink from the expected Catalina log location to a sensitive file such as /etc/shadow or a cron script, then triggers a log rotation or restart via the init script so that the script writes as root to the attacker-controlled target, granting root privileges.

How to fix it

Upgrade step-fips (Chainguard) to version 0.26.2-r1 or later; on Debian and Ubuntu systems ensure tomcat packages are updated to the versions listed in the advisory; remove or restrict write access to log directories for the tomcat user where possible.

How to confirm the fix worked

Verify the installed package version matches or exceeds the fixed release; inspect the init script for proper handling of the log file path without following symlinks; run a non-privileged test that attempts the symlink and confirm the write does not succeed with elevated ownership.

Typical attack path

  1. Obtain access to the tomcat user account on a vulnerable system
  2. Create a symlink replacing the Catalina log file with a path to a privileged target
  3. Trigger log activity or service restart through the init script
  4. Leverage the resulting root-owned file write to escalate privileges

How to detect it

Examine system logs and file integrity data for unexpected symlinks or ownership changes on Tomcat Catalina log files; search process execution history and cron or init logs for tomcat service restarts initiated by non-root accounts; review file creation timestamps around known vulnerable package versions.

  • /var/log/tomcat*/catalina.out -> /etc/passwd
  • /var/log/tomcat*/catalina.out -> /etc/shadow
  • tomcat init script writing as root to symlink target

What your security team should do

  • Immediately upgrade step-fips (Chainguard) to 0.26.2-r1
  • Audit all Tomcat instances for the vulnerable init script versions
  • Restrict tomcat user permissions on log directories and monitor for unexpected symlinks
  • Review systems for prior unauthorized root-owned files in Tomcat log paths

The record

The Tomcat init script in the tomcat7 package before 7.0.56-3+deb8u4 and tomcat8 package before 8.0.14-1+deb8u3 on Debian jessie and the tomcat6 and libtomcat6-java packages before 6.0.35-1ubuntu3.8 on Ubuntu 12.04 LTS, the tomcat7 and libtomcat7-java packages before 7.0.52-1ubuntu0.7 on Ubuntu 14.04 LTS, and tomcat8 and libtomcat8-java packages before 8.0.32-1ubuntu1.2 on Ubuntu 16.04 LTS allows local users with access to the tomcat account to gain root privileges via a symlink attack on the Catalina log file, as demonstrated by /var/log/tomcat7/catalina.out.

Affected packages

Ecosystem Package Introduced Fixed
Debian:7 tomcat6 0 6.0.45+dfsg-1~deb7u2
Debian:7 tomcat7 0 7.0.28-4+deb7u6
Debian:8 tomcat7 0 7.0.56-3+deb8u4
Debian:8 tomcat8 0 8.0.14-1+deb8u3
Red Hat:jboss_enterprise_web_server:3.1::el6 hibernate4-c3p0-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 hibernate4-core-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 hibernate4-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 hibernate4-entitymanager-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 hibernate4-envers-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 jbcs-httpd24-apache-commons-daemon 0 0:1.0.15-1.redhat_2.1.jbcs.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 jbcs-httpd24-apache-commons-daemon-jsvc 0 1:1.0.15-17.redhat_2.jbcs.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 jbcs-httpd24-apache-commons-daemon-jsvc-debuginfo 0 1:1.0.15-17.redhat_2.jbcs.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 jbcs-httpd24-runtime 0 0:1-3.jbcs.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 mod_cluster 0 0:1.3.5-2.Final_redhat_2.1.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 mod_cluster-tomcat7 0 0:1.3.5-2.Final_redhat_2.1.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 mod_cluster-tomcat8 0 0:1.3.5-2.Final_redhat_2.1.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat-native 0 0:1.2.8-9.redhat_9.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat-native-debuginfo 0 0:1.2.8-9.redhat_9.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat-vault 0 0:1.0.8-9.Final_redhat_2.1.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-admin-webapps 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-docs-webapp 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-el-2.2-api 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-javadoc 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-jsp-2.2-api 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-jsvc 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-lib 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-log4j 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-selinux 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-servlet-3.0-api 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat7-webapps 0 0:7.0.70-16.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-admin-webapps 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-docs-webapp 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-el-2.2-api 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-javadoc 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-jsp-2.3-api 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-jsvc 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-lib 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-log4j 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-selinux 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-servlet-3.1-api 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el6 tomcat8-webapps 0 0:8.0.36-17.ep7.el6
Red Hat:jboss_enterprise_web_server:3.1::el7 hibernate4-c3p0-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 hibernate4-core-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 hibernate4-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 hibernate4-entitymanager-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 hibernate4-envers-eap6 0 0:4.2.23-1.Final_redhat_1.1.ep6.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 jbcs-httpd24-apache-commons-daemon 0 0:1.0.15-1.redhat_2.1.jbcs.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 jbcs-httpd24-apache-commons-daemon-jsvc 0 1:1.0.15-17.redhat_2.jbcs.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 jbcs-httpd24-apache-commons-daemon-jsvc-debuginfo 0 1:1.0.15-17.redhat_2.jbcs.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 jbcs-httpd24-runtime 0 0:1-3.jbcs.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 mod_cluster 0 0:1.3.5-2.Final_redhat_2.1.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 mod_cluster-tomcat7 0 0:1.3.5-2.Final_redhat_2.1.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 mod_cluster-tomcat8 0 0:1.3.5-2.Final_redhat_2.1.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat-native 0 0:1.2.8-9.redhat_9.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat-native-debuginfo 0 0:1.2.8-9.redhat_9.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat-vault 0 0:1.0.8-9.Final_redhat_2.1.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-admin-webapps 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-docs-webapp 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-el-2.2-api 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-javadoc 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-jsp-2.2-api 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-jsvc 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-lib 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-log4j 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-selinux 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-servlet-3.0-api 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat7-webapps 0 0:7.0.70-16.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-admin-webapps 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-docs-webapp 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-el-2.2-api 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-javadoc 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-jsp-2.3-api 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-jsvc 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-lib 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-log4j 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-selinux 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-servlet-3.1-api 0 0:8.0.36-17.ep7.el7
Red Hat:jboss_enterprise_web_server:3.1::el7 tomcat8-webapps 0 0:8.0.36-17.ep7.el7
Ubuntu:14.04:LTS tomcat6 0 6.0.39-1ubuntu0.1
Ubuntu:14.04:LTS tomcat7 0 7.0.52-1ubuntu0.7
Ubuntu:16.04:LTS tomcat6 0 6.0.45+dfsg-1ubuntu0.2
Ubuntu:16.04:LTS tomcat7 0 7.0.68-1ubuntu0.3
Ubuntu:16.04:LTS tomcat8 0 8.0.32-1ubuntu1.2

Related vulnerabilities