# CVE-2016-1240: Privilege escalation in n/a

> Local attackers with tomcat account access can gain root privileges via a symlink attack on the Catalina log file in Tomcat init scripts.

- **Severity:** High 7.8 (`CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Oct 2016
- **Updated:** 5 Aug 2024
- **Also known as:** DLA-622-1, DLA-623-1, DSA-3669-1, DSA-3670-1, GHSA-8c5c-v572-37xf, UBUNTU-CVE-2016-1240, USN-3081-1, USN-3081-2

## What is CVE-2016-1240?

CVE-2016-1240 is a high-severity vulnerability in Apache Tomcat, published on 3 Oct 2016. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2016-1240?

It affects 1 product.


Products: Apache Tomcat.

## How do I fix CVE-2016-1240?

Apply the vendor's patch.

## Is CVE-2016-1240 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2016-1240 exists.

Public exploit code:

- Reproducible exploits for: CVE-2016-1240 CVE-2008-2938 CVE-2014-2064 CVE-2014-1904 (github_poc): https://github.com/Naramsim/Offensive
- Apache Tomcat on Ubuntu Log Init Privilege Escalation (metasploit)
- Apache Tomcat 8/7/6 (Debian-Based Distros) - Local Privilege Escalation (exploitdb)
- CVE-2016-1240 exploit and patch (github_poc): https://github.com/mhe18/CVE_Project

## Other vulnerabilities in Apache Tomcat

- [CVE-2025-24813](https://insights.sbomify.com/CVE-2025-24813/): Apache Tomcat Path Equivalence (critical 10.0, exploited in the wild)
- [CVE-2016-8735](https://insights.sbomify.com/CVE-2016-8735/): Apache Tomcat Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2017-12617](https://insights.sbomify.com/CVE-2017-12617/): Apache Tomcat Remote Code Execution (high 8.1, exploited in the wild)
- [CVE-2017-12615](https://insights.sbomify.com/CVE-2017-12615/): Apache Tomcat on Windows Remote Code Execution (high 8.1, exploited in the wild)
- [CVE-2026-34486](https://insights.sbomify.com/CVE-2026-34486/): Apache Tomcat Missing Encryption of Sensitive Data (high 7.5, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-1240 and fix it if it is affected.

What it is: CVE-2016-1240 is a high-severity vulnerability in Apache Tomcat, published on 3 Oct 2016. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2016-1240 exists.

Affected product: Apache Tomcat. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2016-1240/ (Markdown: https://insights.sbomify.com/CVE-2016-1240/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2016-1240
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2016-1240
- OSV: https://osv.dev/vulnerability/CVE-2016-1240

---
From sbomify Insights: https://insights.sbomify.com/CVE-2016-1240/
Summaries are generated and may contain mistakes; the official description above is the record.
