Please update openjdk-lts to 11.0.20.1+1 and openjdk-17 to 17.0.8.1+1 to fix JDK-8313765
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
openjdk-17 (Ubuntu) | Status tracked in Mantic | |||||
Focal |
Fix Released
|
Undecided
|
Unassigned | |||
Jammy |
Fix Released
|
Undecided
|
Unassigned | |||
Lunar |
Fix Released
|
Undecided
|
Unassigned | |||
Mantic |
New
|
Undecided
|
Unassigned | |||
openjdk-lts (Ubuntu) | Status tracked in Mantic | |||||
Focal |
Fix Released
|
Undecided
|
Unassigned | |||
Jammy |
Fix Released
|
Undecided
|
Unassigned | |||
Lunar |
Fix Released
|
Undecided
|
Unassigned | |||
Mantic |
New
|
Undecided
|
Unassigned |
Bug Description
[Background]
JDK-8313765: Invalid CEN header (invalid zip64 extra data field size) was fixed in openjdk 11.0.20.1+1 and openjdk 17.0.8.1+1.
--------------
The following ZipException may be thrown when the data contained in the CEN Extra fields are problematic:
Invalid CEN header (invalid zip64 extra data field size)
The ZipException may occur due to:
1. Some releases of Ant and commons-compress create CEN Zip64 extra headers with a size of 0 when Zip64 mode is required
- fixed in Commons-compress 1.11 (2016) and Ant 1.10.14 (2023).
2. Extra field includes padding not included in the Extra data field headers
3. The BND tool added problematic data to the extra field
- fixed in BND 5.3 (2021) and maven-bundle-plugin 5.1.5 which includes BND 5.3
The issue can demonstrated via the following ant script :
?xml version="1.0"?>
<project name="zip 64 jar test" basedir="." default="jar">
<property name="jarFile" value="test.jar"/>
<property name="builddir" value="classes"/>
<target name="jar">
<jar destfile=
</target>
</project>
----------------
[1]
[Impact]
This means that zip64 jar files made by older versions of commons-compress and more importantly Ant are not readable by the July security update JDKs (11.0.20 and 17.0.8). The user is unable to run existing software. The latest version of ant in the archive is 1.10.13[2] which means that all relevant Ubuntu versions (bionic, focal, jammy, lunar, mantic) are affected.
The behaviour can be worked around with jdk.util.
[Suggested Fix]
Release upstream versions 11.0.20.1+1 and 17.0.8.1+1 to affected versions - bionic (esm), focal, jammy, lunar, mantic.
[Test Plan]
Ensure that the test jar file can be run using the fixed version.
-------
#!/bin/bash
for release in bionic focal jammy lunar mantic; do
for jdk in openjdk-
echo -------testing $release with $jdk
lxc launch ubuntu-
lxc exec tester -- apt-get update
lxc exec tester -- apt-get -y install ${jdk} ant
lxc file push validate-fix.sh tester/
lxc exec tester -- /bin/bash /home/ubuntu/
lxc stop tester
lxc delete tester
echo -------DONE testing $release with $jdk
done
done
-------
validate-fix.sh is attached to the bug.
[Where the problems can occur]
- validate that the zip file can run when Security manager is enabled and a permission to read 'jdk.util.
[1] https:/
[2] https:/
Related branches
- Steve Beattie (community): Approve
- git-ubuntu import: Pending requested
-
Diff: 1188 lines (+1015/-17)9 files modified.jcheck/conf (+1/-1)
debian/changelog (+10/-0)
debian/tests/jtreg-autopkgtest.in (+1/-0)
debian/tests/jtreg-autopkgtest.sh (+1/-0)
make/autoconf/version-numbers (+2/-2)
src/java.base/share/classes/java/util/zip/ZipFile.java (+43/-10)
src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java (+13/-1)
test/jdk/java/util/zip/ZipFile/CorruptedZipFiles.java (+4/-3)
test/jdk/java/util/zip/ZipFile/ReadNonStandardExtraHeadersTest.java (+940/-0)
- Steve Beattie (community): Approve
- git-ubuntu import: Pending requested
-
Diff: 1304 lines (+1039/-25)15 files modified.jcheck/conf (+1/-1)
debian/changelog (+16/-0)
debian/control (+2/-1)
debian/control.in (+2/-1)
debian/patches/build_gtest.patch (+5/-3)
debian/patches/exclude-broken-tests.patch (+6/-3)
debian/rules (+1/-1)
debian/tests/jtreg-autopkgtest.in (+1/-0)
debian/tests/jtreg-autopkgtest.sh (+1/-0)
debian/tests/problems-armhf.txt (+4/-0)
make/conf/version-numbers.conf (+2/-2)
src/java.base/share/classes/java/util/zip/ZipFile.java (+43/-9)
src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java (+13/-1)
test/jdk/java/util/zip/ZipFile/CorruptedZipFiles.java (+4/-3)
test/jdk/java/util/zip/ZipFile/ReadNonStandardExtraHeadersTest.java (+938/-0)
Reproducer for the issue. openjdk/ extra-security- release 7-Ubuntu- 123.04) 7-Ubuntu- 123.04, mixed mode, sharing) VPUpz6BvYH/ build.xml
----
$ ./validate-fix.sh
/tmp/tmp.VPUpz6BvYH ~/git/make-
openjdk 17.0.8 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+
OpenJDK 64-Bit Server VM (build 17.0.8+
Buildfile: /tmp/tmp.
build: VPUpz6BvYH/ build.xml: 4: warning: 'includeantruntime' was not set, defaulting to build.sysclassp ath=last; set to false for repeatable builds VPUpz6BvYH/ classes
[javac] /tmp/tmp.
[javac] Compiling 1 source file to /tmp/tmp.
jar: VPUpz6BvYH/ test.jar
[jar] Building jar: /tmp/tmp.
BUILD SUCCESSFUL ClassNotFoundEx ception: Test
Total time: 0 seconds
1. Validation enabled and class not found due to the bug
Error: Could not find or load main class Test
Caused by: java.lang.
2. Validation disabled and class is found
Hello world!
--------------