The tomcat8
package for bionic (18.04LTS) is currently 8.5.39-1ubuntu1~18.04.3
and focal (20.04LTS) already has tomcat9
. You are already at the newest version for your distribution!
You could install packages from another version of Ubuntu, but that might break some dependencies: it makes maintaining your system harder or in worst case renders it useless. You could also compile your own, but in that case, you lose all automatic security updates: either your system becomes vulnerable or you need to compile your Tomcat over and over again.
For everyone who needs to ask this question messing up with the repositories is extremely dangerous and never recommended. If you really needed a newer version for compatibility reasons or the new features provided, you should rather upgrade your whole distribution.
For security updates you should wait until its fixed in the distribution. This is reasoned quite well in DontBreakDebian: Don't suffer from Shiny New Stuff Syndrome, and applies to Ubuntu as well:
Before attempting to install the newest version of some software from
somewhere other than the Debian Stable repositories, here are some
things to keep in mind:
Debian backports security fixes and new features, judging software by comparing the version number of the Debian package to the upstream
version number does not take this into account.
The latest version of the software you're trying to use might also have new bugs.
Installing software from places other than official Debian repositories are not covered by Debian' Security team.
However, upgrading the package is a XY problem, and instead of upgrading you should be...
Addressing the GhostCat (CVE-2020-1938)
The GhostCat is a vulnerability related to default configuration rather than code. From the description for CVE-2020-1938:
Tomcat treats AJP connections as having higher trust than, for
example, a similar HTTP connection. If such connections are available
to an attacker, they can be exploited in ways that may be surprising.
In Apache Tomcat 9.0.0.M1 to 9.0.0.30, 8.5.0 to 8.5.50 and 7.0.0 to
7.0.99, Tomcat shipped with an AJP Connector enabled by default that listened on all configured IP addresses. It was expected (and
recommended in the security guide) that this Connector would be
disabled if not required.
The AJP connector causing the vulnerability is disabled in Ubuntu by default (Comment #1 for bug #1865904). If you have enabled the AJP connector, disabling the connector or limiting access to it should fix the problem.