diff --git a/change-defaults-for-CVE-2020-1938.patch b/change-defaults-for-CVE-2020-1938.patch new file mode 100644 index 0000000..02ed0df --- /dev/null +++ b/change-defaults-for-CVE-2020-1938.patch @@ -0,0 +1,71 @@ +diff -up ./java/org/apache/coyote/ajp/AbstractAjpProtocol.java.orig ./java/org/apache/coyote/ajp/AbstractAjpProtocol.java +--- ./java/org/apache/coyote/ajp/AbstractAjpProtocol.java.orig 2020-04-22 15:31:12.889587528 -0400 ++++ ./java/org/apache/coyote/ajp/AbstractAjpProtocol.java 2020-04-22 15:31:37.907534419 -0400 +@@ -16,7 +16,6 @@ + */ + package org.apache.coyote.ajp; + +-import java.net.InetAddress; + import java.util.regex.Pattern; + + import org.apache.coyote.AbstractProtocol; +@@ -49,8 +48,6 @@ public abstract class AbstractAjpProtoco + setConnectionTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); + // AJP does not use Send File + getEndpoint().setUseSendfile(false); +- // AJP listens on loopback by default +- getEndpoint().setAddress(InetAddress.getLoopbackAddress()); + ConnectionHandler cHandler = new ConnectionHandler<>(this); + setHandler(cHandler); + getEndpoint().setHandler(cHandler); +@@ -180,7 +177,7 @@ public abstract class AbstractAjpProtoco + } + + +- private boolean secretRequired = true; ++ private boolean secretRequired = false; + public void setSecretRequired(boolean secretRequired) { + this.secretRequired = secretRequired; + } +diff -up ./webapps/docs/changelog.xml.orig ./webapps/docs/changelog.xml +--- ./webapps/docs/changelog.xml.orig 2020-04-03 08:12:03.000000000 -0400 ++++ ./webapps/docs/changelog.xml 2020-04-22 15:31:37.911534411 -0400 +@@ -526,14 +526,10 @@ + Disable (comment out in server.xml) the AJP/1.3 connector by default. + (markt) + +- +- Change the default bind address for the AJP/1.3 connector to be the +- loopback address. (markt) +- + + Rename the requiredSecret attribute of the AJP/1.3 + Connector to secret and add a new attribute +- secretRequired that defaults to true. When ++ secretRequired that defaults to false. When + secretRequired is true the AJP/1.3 Connector + will not start unless the secret attribute is configured to + a non-null, non-zero length String. (markt) +diff -up ./webapps/docs/config/ajp.xml.orig ./webapps/docs/config/ajp.xml +--- ./webapps/docs/config/ajp.xml.orig 2020-04-22 15:31:37.913534406 -0400 ++++ ./webapps/docs/config/ajp.xml 2020-04-22 15:35:35.003031090 -0400 +@@ -327,7 +327,9 @@ + +

For servers with more than one IP address, this attribute specifies + which address will be used for listening on the specified port. By +- default, the connector will listen on the loopback address. Unless the JVM ++ default, this port will be used on all IP addresses associated with the ++ server. A value of 127.0.0.1 indicates that the Connector ++ will only listen on the loopback interface. Unless the JVM + is configured otherwise using system properties, the Java based connectors + (NIO, NIO2) will listen on both IPv4 and IPv6 addresses when configured + with either 0.0.0.0 or ::. The APR/native +@@ -500,7 +502,7 @@ + the secret attribute is required to be specified for the + AJP Connector to start. It does not control whether + workers are required to provide the secret. The default value is +- true. This attribute should only be set to false ++ false. This attribute should only be set to false + when the Connector is used on a trusted network.

+
+ diff --git a/rhbz-1857043.patch b/rhbz-1857043.patch new file mode 100644 index 0000000..3730769 --- /dev/null +++ b/rhbz-1857043.patch @@ -0,0 +1,200 @@ +diff -up ./build.xml.orig ./build.xml +--- ./build.xml.orig 2020-07-24 10:24:08.313796968 -0400 ++++ ./build.xml 2020-07-24 10:24:38.027427445 -0400 +@@ -757,7 +757,7 @@ + filesDir="${tomcat.classes}" + filesId="files.annotations-api" + manifest="${tomcat.manifests}/annotations-api.jar.manifest" +- addOSGi="true" /> ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + ++ addOSGi="false" /> + + + +diff -up ./build.xml.orig ./build.xml +--- ./build.xml.orig 2020-07-13 12:59:09.555368724 -0400 ++++ ./build.xml 2020-07-13 13:06:51.246135917 -0400 +@@ -3307,6 +3307,11 @@ Read the Building page on the Apache Tom + + - ++ + + + ++ - + +diff -up ./res/bnd/build-defaults.bnd.orig ./res/bnd/build-defaults.bnd +--- ./res/bnd/build-defaults.bnd.orig 2020-07-13 13:47:01.229077747 -0400 ++++ ./res/bnd/build-defaults.bnd 2020-07-13 13:47:12.923095618 -0400 +@@ -13,7 +13,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-Bundle-Version: ${version_cleanup;${version}} ++Bundle-Version: ${version} + + Specification-Title: Apache Tomcat + Specification-Version: ${version.major.minor} diff --git a/tomcat.spec b/tomcat.spec index d53c576..4ef9c91 100644 --- a/tomcat.spec +++ b/tomcat.spec @@ -31,7 +31,7 @@ %global jspspec 2.3 %global major_version 9 %global minor_version 0 -%global micro_version 26 +%global micro_version 39 %global packdname apache-tomcat-%{version}-src %global servletspec 4.0 %global elspec 3.0 @@ -81,6 +81,10 @@ Source32: tomcat-named.service Patch0: %{name}-%{major_version}.%{minor_version}-bootstrap-MANIFEST.MF.patch Patch1: %{name}-%{major_version}.%{minor_version}-tomcat-users-webapp.patch Patch2: %{name}-build.patch +Patch3: change-defaults-for-CVE-2020-1938.patch +Patch4: %{name}-%{major_version}.%{minor_version}-catalina-policy.patch +Patch5: rhbz-1857043.patch +Patch6: %{name}-%{major_version}.%{minor_version}-LogFactory.patch BuildArch: noarch @@ -206,6 +210,10 @@ find . -type f \( -name "*.bat" -o -name "*.class" -o -name Thumbs.db -o -name " %patch0 -p0 %patch1 -p0 %patch2 -p0 +%patch3 -p0 +%patch4 -p0 +%patch5 -p0 +%patch6 -p0 %{__ln_s} $(build-classpath tomcat-taglibs-standard/taglibs-standard-impl) webapps/examples/WEB-INF/lib/jstl.jar %{__ln_s} $(build-classpath tomcat-taglibs-standard/taglibs-standard-compat) webapps/examples/WEB-INF/lib/standard.jar @@ -234,7 +242,9 @@ export OPT_JAR_LIST="xalan-j2-serializer" -Dbndlib.jar="$(build-classpath aqute-bnd/biz.aQute.bndlib)" \ -Dbndlibg.jar="$(build-classpath aqute-bnd/aQute.libg)" \ -Dbndannotation.jar="$(build-classpath aqute-bnd/biz.aQute.bnd.annotation)" \ + -Dosgi-annotations.jar="$(build-classpath aqute-bnd/biz.aQute.bnd.annotation)" \ -Dslf4j-api.jar="$(build-classpath slf4j/slf4j-api)" \ + -Dosgi-cmpn.jar="$(build-classpath osgi-compendium/osgi.cmpn)" \ -Dversion="%{version}" \ -Dversion.build="%{micro_version}" \ deploy dist-source @@ -610,6 +620,41 @@ fi %attr(0660,tomcat,tomcat) %verify(not size md5 mtime) %{logdir}/catalina.out %changelog +* Fri Nov 06 2020 Hui Wang - 1:9.0.39-1 +- Update to 9.0.39 +- Revert upstream fix d1f4d8712ddb52857f40a8cc4a82bf8b8e013f88 for LogFactory.java because of our lower version of bnd + +* Mon Sep 21 2020 Hui Wang - 1:9.0.38-2 +- Related: rhbz#1857043 Temporarily remove OSGi metadata from tomcat jars + +* Wed Sep 16 2020 Hui Wang - 1:9.0.38-1 +- Update to 9.0.38 + +* Wed Jul 15 2020 Hui Wang - 1:9.0.37-1 +- Upgrade to 9.0.37 + +* Wed Jun 10 2020 Hui Wang - 1:9.0.36-1 +- Upgrade to 9.0.36 + +* Sun May 31 2020 Hui Wang - 1:9.0.35-2 +- Upgrade to 9.0.35 + +* Wed Apr 22 2020 Coty Sutherland - 1:9.0.34-2 +- Add updated catalina.policy patch to allow ECJ usage under the Security Manager + +* Tue Apr 21 2020 Coty Sutherland - 1:9.0.34-1 +- Update to 9.0.34 + +* Thu Mar 12 2020 Coty Sutherland - 1:9.0.31-2 +- Related: rhbz#1806398 Undo changes in defaults for AJP connector (CVE-2020-1938) to prevent breakage, please update your configuration accordingly + +* Thu Mar 05 2020 Coty Sutherland - 1:9.0.31-1 +- Update to 9.0.31 +- Resolves: rhbz#1806398 - CVE-2020-1938 tomcat: Apache Tomcat AJP File Read/Inclusion Vulnerability + +* Fri Dec 20 2019 Coty Sutherland - 1:9.0.30-1 +- Update to 9.0.30 + * Thu Sep 26 2019 Coty Sutherland - 1:9.0.26-1 - Update to 9.0.26 - Resolves: rhbz#1523112 tomcat systemd does not cope with - in service names