[Git][java-team/tomcat9][master] 7 commits: drop -XX:+UseG1GC from standard JAVA_OPTS (Closes: #925928)

Emmanuel Bourg gitlab at salsa.debian.org
Thu Jun 13 22:51:01 BST 2019



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / tomcat9


Commits:
ae1d3ba2 by mirabilos at 2019-06-02T21:06:08Z
drop -XX:+UseG1GC from standard JAVA_OPTS (Closes: #925928)

rationale: the JRE chooses a suitable GC automatically anyway,
and some VMs (notably Zero) don’t support this flag and then
refuse to start; but suggest Java 8 users to add it back,
from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925928#22

- - - - -
31876634 by mirabilos at 2019-06-02T23:24:02Z
fix /var/log/tomcat9 to belong to group adm, chmod 2750 (Closes: #925929)

rationale: Debian commonplace allows users in the group adm
to read logs

also add missing RequiresMountsFor for systemd; related fixes
From: Felipe Sateler <fsateler at debian.org>

- - - - -
96b67ff8 by mirabilos at 2019-06-02T23:26:33Z
unbreak $SECURITY_MANAGER (which $TOMCAT_SECURITY was renamed to)

- - - - -
1242f8a7 by mirabilos at 2019-06-02T23:26:33Z
make sourced scriptlet not executable (makes no sense anyway)

- - - - -
a40b411a by Christian Hänsel at 2019-06-02T23:26:33Z
Restored the variable expansion in /etc/default/tomcat9 (Closes: #926319)

- - - - -
ca79dadc by Emmanuel Bourg at 2019-06-02T23:26:33Z
Fixed CVE-2019-0221: XSS in SSI printenv (Closes: #929895)

- - - - -
805338f6 by Emmanuel Bourg at 2019-06-13T21:26:20Z
Upload to unstable

- - - - -


10 changed files:

- debian/changelog
- debian/default.template
- debian/libexec/tomcat-locate-java.sh
- debian/libexec/tomcat-start.sh
- + debian/patches/CVE-2019-0221.patch
- debian/patches/series
- debian/setenv.sh
- debian/tomcat9.postinst
- debian/tomcat9.service
- + debian/tomcat9.tmpfile


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,26 @@
+tomcat9 (9.0.16-4) unstable; urgency=medium
+
+  * Team upload.
+
+  [ Emmanuel Bourg ]
+  * Fixed CVE-2019-0221: The SSI printenv command echoes user provided data
+    without escaping and is, therefore, vulnerable to XSS. SSI is disabled
+    by default (Closes: #929895)
+
+  [ Thorsten Glaser ]
+  * Remove -XX:+UseG1GC from standard JAVA_OPTS; the JRE chooses
+    a suitable GC automatically anyway (Closes: #925928)
+  * Correct the ownership and permissions on the log directory:
+    group adm and setgid (Closes: #925929)
+  * Make the startup script honour the (renamed) $SECURITY_MANAGER
+  * debian/libexec/tomcat-locate-java.sh: Remove shebang and make
+    not executable as this is only ever sourced (makes no sense otherwise)
+
+  [ Christian Hänsel ]
+  * Restored the variable expansion in /etc/default/tomcat9 (Closes: #926319)
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Thu, 13 Jun 2019 23:26:12 +0200
+
 tomcat9 (9.0.16-3) unstable; urgency=medium
 
   * Removed read/write access to /var/lib/solr (Closes: #923299)


=====================================
debian/default.template
=====================================
@@ -3,9 +3,10 @@
 # OpenJDK and the Oracle JDK are tried.
 #JAVA_HOME=/usr/lib/jvm/java-8-openjdk
 
-# You may pass JVM startup parameters to Java here. If unset, the default
-# options will be: -Djava.awt.headless=true -XX:+UseG1GC
-JAVA_OPTS="-Djava.awt.headless=true -XX:+UseG1GC"
+# You may pass JVM startup parameters to Java here. If you run Tomcat with
+# Java 8 instead of 9 or newer, add "-XX:+UseG1GC" to select a suitable GC.
+# If unset, the default options will be: -Djava.awt.headless=true
+JAVA_OPTS="-Djava.awt.headless=true"
 
 # To enable remote debugging uncomment the following line.
 # You will then be able to use a Java debugger on port 8000.


=====================================
debian/libexec/tomcat-locate-java.sh
=====================================
@@ -1,4 +1,3 @@
-#!/bin/sh
 #
 # Script looking for a Java runtime suitable for running Tomcat
 #


=====================================
debian/libexec/tomcat-start.sh
=====================================
@@ -5,6 +5,9 @@
 
 set -e
 
+# Load the service settings
+. /etc/default/tomcat9
+
 # Find the Java runtime and set JAVA_HOME
 . /usr/libexec/tomcat9/tomcat-locate-java.sh
 
@@ -15,7 +18,7 @@ export JAVA_OPTS
 
 # Enable the Java security manager?
 SECURITY=""
-[ "$TOMCAT_SECURITY" = "yes" ] && SECURITY="-security"
+[ "$SECURITY_MANAGER" = "true" ] && SECURITY="-security"
 
 
 # Start Tomcat


=====================================
debian/patches/CVE-2019-0221.patch
=====================================
@@ -0,0 +1,16 @@
+Description: Fixes CVE-2019-0221: The SSI printenv command echoes user provided
+ data without escaping and is, therefore, vulnerable to XSS. SSI is disabled by
+ default.
+Origin: upstream, https://github.com/apache/tomcat/commit/15fcd16
+--- a/java/org/apache/catalina/ssi/SSIPrintenv.java
++++ b/java/org/apache/catalina/ssi/SSIPrintenv.java
+@@ -41,8 +41,7 @@
+         } else {
+             Collection<String> variableNames = ssiMediator.getVariableNames();
+             for (String variableName : variableNames) {
+-                String variableValue = ssiMediator
+-                        .getVariableValue(variableName);
++                String variableValue = ssiMediator.getVariableValue(variableName, "entity");
+                 //This shouldn't happen, since all the variable names must
+                 // have values
+                 if (variableValue == null) {


=====================================
debian/patches/series
=====================================
@@ -11,3 +11,4 @@
 0024-systemd-log-formatter.patch
 0025-invalid-configuration-exit-status.patch
 0026-easymock4-compatibility.patch
+CVE-2019-0221.patch


=====================================
debian/setenv.sh
=====================================
@@ -8,5 +8,5 @@ CATALINA_HOME=/usr/share/tomcat9
 
 # Default Java options
 if [ -z "$JAVA_OPTS" ]; then
-	JAVA_OPTS="-Djava.awt.headless=true -XX:+UseG1GC"
+	JAVA_OPTS="-Djava.awt.headless=true"
 fi


=====================================
debian/tomcat9.postinst
=====================================
@@ -63,8 +63,10 @@ case "$1" in
 	chmod 775 /var/lib/tomcat9/webapps
 
 	# Grant read/write access to tomcat to the log and cache directories
-	chown -Rh $TOMCAT_USER:$TOMCAT_GROUP /var/log/tomcat9/ /var/cache/tomcat9/
-	chmod 750 /var/log/tomcat9/ /var/cache/tomcat9/
+	chown -Rh $TOMCAT_USER:adm /var/log/tomcat9/
+	chmod 2750 /var/log/tomcat9/
+	chown -Rh $TOMCAT_USER:$TOMCAT_GROUP /var/cache/tomcat9/
+	chmod 750 /var/cache/tomcat9/
     ;;
 esac
 


=====================================
debian/tomcat9.service
=====================================
@@ -14,7 +14,6 @@ Environment="CATALINA_HOME=/usr/share/tomcat9"
 Environment="CATALINA_BASE=/var/lib/tomcat9"
 Environment="CATALINA_TMPDIR=/tmp"
 Environment="JAVA_OPTS=-Djava.awt.headless=true"
-EnvironmentFile=-/etc/default/tomcat9
 
 # Lifecycle
 Type=simple
@@ -32,13 +31,13 @@ Group=tomcat
 PrivateTmp=yes
 AmbientCapabilities=CAP_NET_BIND_SERVICE
 NoNewPrivileges=true
-LogsDirectory=tomcat9
-LogsDirectoryMode=750
 CacheDirectory=tomcat9
 CacheDirectoryMode=750
 ProtectSystem=strict
 ReadWritePaths=/etc/tomcat9/Catalina/
 ReadWritePaths=/var/lib/tomcat9/webapps/
+ReadWritePaths=/var/log/tomcat9/
+RequiresMountsFor=/var/log/tomcat9
 
 [Install]
 WantedBy=multi-user.target


=====================================
debian/tomcat9.tmpfile
=====================================
@@ -0,0 +1,6 @@
+# Tomcat log directory permissions
+
+# See tmpfiles.d(5) for details
+
+# Type Path        Mode UID    GID  Age Argument
+d /var/log/tomcat9 2750 tomcat adm  -



View it on GitLab: https://salsa.debian.org/java-team/tomcat9/compare/ca0f08fc57c5617268815752f3d206a5b9358a0b...805338f6448639cd46827b0bf502b7c87c91ece0

-- 
View it on GitLab: https://salsa.debian.org/java-team/tomcat9/compare/ca0f08fc57c5617268815752f3d206a5b9358a0b...805338f6448639cd46827b0bf502b7c87c91ece0
You're receiving this email because of your account on salsa.debian.org.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190613/18bb10bc/attachment.html>


More information about the pkg-java-commits mailing list