CVE-2014-1876: Medium severity ORACLE OpenJDK vulnerability
Jakub Wilk reported in a Debian bug report [1] that the unpack200 program included in OpenJDK did not properly handle the logfile properly. If the the log file was unable to be opened, it would create /tmp/unpack.log instead as the fallback, but do so in an insecure manner, as shown in unpack.cpp (the below is from OpenJDK 6):
4732 void unpacker::redirectstdio() { ... 4757 #else 4758 sprintf(tmpdir,"/tmp"); 4759 sprintf(logfilename, "/tmp/unpack.log"); 4760 #endif 4761 if ((errstrm = fopen(logfilename, "a+")) != NULL) { 4762 logfile = errstrmname = saveStr(logfilename); 4763 return ; 4764 } 4765 4766 char tname = tempnam(tmpdir,"#upkg"); 4767 sprintf(logfilename, "%s", tname); 4768 if ((errstrm = fopen(logfilename, "a+")) != NULL) { 4769 logfile = errstrmname = saveStr(logfilename); 4770 return ; 4771 }
The same exists in OpenJDK 7 and 8.
This could allow a malicious local attacker to conduct local attacks, such as symlink attacks, where a file could be overwritten if the user running unpack200 had write permissions.
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737562
Other sources
The unpacker::redirectstdio function in unpack.cpp in unpack200 in OpenJDK 6, 7, and 8; Oracle Java SE 5.0u61, 6u71, 7u51, and 8; JRockit R27.8.1 and R28.3.1; and Java SE Embedded 7u51 does not securely create temporary files when a log file cannot be opened, which allows local users to overwrite arbitrary files via a symlink attack on /tmp/unpack.log.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.7.0-oracle-1:1.7.0.55-1jpp.2.el5_10 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.6.0-sun-1:1.6.0.75-1jpp.3.el5_10 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.7.0-oracle-1:1.7.0.55-1jpp.1.el6_5 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.6.0-sun-1:1.6.0.75-1jpp.1.el6_5 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.7.0-openjdk-1:1.7.0.55-2.4.7.1.el5_10 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.6.0-openjdk-1:1.6.0.0-5.1.13.3.el5_10 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.7.0-openjdk-1:1.7.0.55-2.4.7.1.el6_5 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.6.0-openjdk-1:1.6.0.0-5.1.13.3.el6_5 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.7.0-openjdk-1:1.7.0.55-2.4.7.2.el7_0 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.6.0-openjdk-1:1.6.0.0-6.1.13.3.el7_0 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.6.0-ibm-1:1.6.0.16.0-1jpp.1.el5 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.7.0-ibm-1:1.7.0.7.0-1jpp.1.el5_10 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.6.0-ibm-1:1.6.0.16.0-1jpp.1.el5_10 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.5.0-ibm-1:1.5.0.16.6-1jpp.1.el5_10 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.7.0-ibm-1:1.7.0.7.0-1jpp.1.el6_5 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.6.0-ibm-1:1.6.0.16.0-1jpp.1.el6_5 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.5.0-ibm-1:1.5.0.16.6-1jpp.1.el6_5 - Upgrade
Upgrade
redhat/javato a version that resolves this vulnerability.Fixed in 1.7.1-ibm-1:1.7.1.1.0-1jpp.2.el7_0 - Upgrade
Upgrade
redhat/icedteato a version that resolves this vulnerability.Fixed in 1.13.3 - Upgrade
Upgrade
redhat/icedteato a version that resolves this vulnerability.Fixed in 2.4.7
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the severity of CVE-2014-1876?
CVE-2014-1876 has a medium severity level due to its potential impact on security when the unpack200 program mishandles log files.
How do I fix CVE-2014-1876?
To fix CVE-2014-1876, update the OpenJDK package to the latest version as specified in the remediation details.
Which versions are affected by CVE-2014-1876?
CVE-2014-1876 affects OpenJDK versions 1.6.0 and 1.7.0 prior to the security updates.
Is CVE-2014-1876 related to specific distributions?
Yes, CVE-2014-1876 impacts specific Red Hat distributions and versions of OpenJDK as detailed in the vulnerability report.
What should I monitor after addressing CVE-2014-1876?
After addressing CVE-2014-1876, monitor your systems for any anomalous behavior related to the unpack200 program.