How To

Tomcat CVE-2026-76183: Check and Patch the WebSocket Auth Bypass

An unpatched Tomcat lets anyone reach a WebSocket endpoint that your web.xml security constraints were supposed to lock behind a login. That’s CVE-2026-76183, rated 9.8 under CVSS 3.1: Tomcat parsed request paths as endpoint templates, so a crafted path slipped past the constraint and opened the socket. Its companion, CVE-2026-101296, hits a narrower group. A JNDIRealm that binds to LDAP with a SASL mechanism other than GSSAPI accepts a login without the correct password.

Original content from computingforgeeks.com - post 200365

Both are fixed upstream, but the distro packages are uneven. Ubuntu and Amazon Linux ship fixed builds, Debian stable ships none, and Red Hat’s RHEL 10 advisory carries the fix for both while only listing one, which hides it from dnf --cve. We ran every check and upgrade on Ubuntu 26.04 and 24.04, Debian 13 and 12, RHEL 10.3 and Amazon Linux 2023 and 2 lab hosts at the end of November, then rechecked the trackers and exploitation data in December 2026. Each change ended with a Tomcat restart and a look at the installed version, so nothing below assumes a package did what its advisory says.

Fixed Tomcat packages per distro

Upstream fixed CVE-2026-76183 in 9.0.122, 10.1.60 and 11.0.26, and CVE-2026-101296 one release later, in 9.0.123, 10.1.61 and 11.0.27. A host is clear of both only at those later releases or a distro build that backports them. Rows marked “Lab” were installed and queried on our test machines between 28 and 30 November 2026; “Tracker” rows come from the distro’s own security pages.

DistroReleasePackageFixed build (both CVEs)AdvisoryChecked
Ubuntu26.04 LTStomcat1111.0.27~us1-0ubuntu1~26.04.1USN-9186-1Lab
Ubuntu26.04 LTStomcat1010.1.61~us1-0ubuntu1~26.04.1USN-9186-1Tracker
Ubuntu24.04 LTStomcat1010.1.61~us1-0ubuntu1~24.04.2USN-9186-1Lab
UbuntuAll releasestomcat9No fix, needs evaluationNone yetTracker
Debian13 trixietomcat11, tomcat10No fix (11.0.22-1~deb13u1 and 10.1.60-1~deb13u1 listed vulnerable)None yetLab (tomcat11), Tracker
Debian12 bookwormtomcat10No fix (10.1.60-1~deb12u1 listed vulnerable)None yetLab
Debian12 bookworm, 13 trixietomcat9Marked fixed at 9.0.70-2 (bookworm) and 9.0.95-1 (trixie), but these builds ship no Tomcat serverTracker noteLab (bookworm), Tracker
Debian14 forky, sidtomcat10, tomcat1110.1.62-1, 11.0.29-1TrackerTracker
RHEL10.3tomcat1:10.1.61-1.el10_3RHSA-2026:104827Lab
RHEL10.2 EUS, 10.0 EUStomcat1:10.1.61-1.el10_2, 1:10.1.61-1.el10_0RHSA-2026:104826, RHSA-2026:104828Advisory
RHEL9.9tomcat1:9.0.123-1.el9_9RHSA-2026:104856Advisory
RHEL9.2, 9.4, 9.6, 9.8 EUS/E4Stomcat9.0.123 buildsRHSA-2026:104860, 104857, 104859, 104858Advisory
RHEL8tomcatNo fix, listed as affectedNone yetAdvisory
RHEL10tomcat9No fix, listed as affectedNone yetAdvisory
AlmaLinux, Rocky Linux10tomcatNo rebuild of RHSA-2026:104827 yetNone yetTracker
Amazon Linux2023tomcat101:10.1.61-1.amzn2023.0.1ALAS2023-2026-3165 (76183), ALAS2023-2026-3420 (101296)Lab
Amazon Linux2023tomcat111:11.0.29-1.amzn2023.0.1ALAS2023-2026-3151 (76183), ALAS2023-2026-3488 (101296)Lab
Amazon Linux2023tomcat91:9.0.123-1.amzn2023.0.1ALAS2023-2026-3166 (76183), ALAS2023-2026-3472 (101296)Lab
Amazon Linux2tomcat (7.0.76)7.0.76-10.amzn2.0.20ALAS2-2026-4019 (76183, .19), ALAS2-2026-4089 (101296, .20)Lab
Amazon Linux2 (tomcat9 topic)tomcat9.0.123-1.amzn2.0.1ALAS2TOMCAT9-2026-029 (76183), ALAS2TOMCAT9-2026-030 (101296)Lab
Apache upstream9.0, 10.1, 11.0Tomcat9.0.123, 10.1.61, 11.0.27Apache security pagesAdvisory

Debian is the trap in this table. Its tracker marks tomcat9 “fixed” at 9.0.70-2 on bookworm and 9.0.95-1 on trixie, and its own note explains why: from 9.0.70-2 the source package no longer ships the server stack. The tomcat9 changelog entry for that upload says it dropped the server packages and kept only libtomcat9-java, and on our bookworm host apt-cache policy tomcat9 showed no installable candidate. That “fixed” status therefore protects no running server, and a host still carrying an old tomcat9 server from an earlier release is unpatched. The tomcat10 and tomcat11 server packages on bookworm and trixie are still listed as vulnerable to both CVEs. Track the late packages on the Debian security tracker, the Ubuntu CVE page, Red Hat’s CVE page and the Amazon Linux security center, and compare them against Apache’s own Tomcat 10 vulnerability list.

Not everything was checked. We did not lab Ubuntu 22.04, which ships only tomcat9 and has no fix, or SUSE, Alpine, or the Tomcat inside container images and vendor bundles. AlmaLinux 10 and Rocky Linux 10 were read from their errata feeds, not booted.

Exploitation status and severity scores

Every public exploitation signal was quiet when we rechecked on 1 December 2026, and each of these held for both CVEs:

  • Neither CVE appears in CISA’s Known Exploited Vulnerabilities catalog, version 2026.11.27.
  • CISA’s SSVC entry on each CVE record reads exploitation “none”.
  • FIRST’s EPSS scores CVE-2026-76183 at 0.00685 and CVE-2026-101296 at 0.00582.
  • NVD lists both records as awaiting analysis, with no NVD score yet.

Low numbers today don’t mean low risk next week. An authentication bypass on a network service with a 9.8 score can get a public proof of concept quickly once researchers diff the fix commit, and Apache linked those commits from its advisory.

Watch which score you quote, because the two CVEs carry different numbers in different places. CVE-2026-76183 is 9.8 under CVSS 3.1. CVE-2026-101296 is 8.1 under CVSS 3.1 and 9.1 under CVSS 4.0; the 9.1 that circulates for it is the 4.0 score, not a 3.1 score. Apache rates both Important, and Red Hat rates both Important with its own score of 7.4.

The configurations each flaw needs

A vulnerable version number is the first condition, not the only one. Both bugs bypass a control you configured, so a host without that control has nothing to bypass. Your server is exposed to CVE-2026-76183 only when all three of these hold:

  • The Tomcat build is older than 9.0.122, 10.1.60 or 11.0.26, or is an end of support 8.5 or 7.0 release.
  • A deployed web application registers a WebSocket endpoint, through @ServerEndpoint, ServerApplicationConfig or a programmatic ServerEndpointConfig.
  • A security-constraint in that application is the only thing between an anonymous client and the endpoint.

CVE-2026-101296 needs a JNDIRealm whose authentication attribute names a SASL mechanism such as DIGEST-MD5. A realm with authentication="simple", with the attribute left out, or with GSSAPI is not affected, and neither is any other realm type. The fix sits in the path where the realm checks a password by binding as the user, so a realm that compares a userPassword attribute instead is outside it too. That makes 101296 rare in practice, but where it exists it hands out logins to the Manager app or whatever the realm guards. If a reverse proxy enforces authentication before traffic reaches Tomcat, the WebSocket bypass is blunted too, though we would not lean on that alone.

Version and exposure checks on your hosts

Start with the package version, then confirm what the running server reports, because a tarball install under /opt won’t show up in the package manager. On Debian and Ubuntu, list every Tomcat package that is actually installed:

dpkg-query -W -f='${Package} ${Version}\n' 'tomcat*' 'libtomcat*' 2>/dev/null | grep -v '^\S* $'

The Ubuntu 24.04 lab host still had the release pocket build, which predates both fixes:

libtomcat10-java 10.1.16-1
tomcat10 10.1.16-1
tomcat10-common 10.1.16-1

On the RHEL family and Amazon Linux, rpm -q tomcat tomcat9 tomcat10 tomcat11 does the same job. Then ask Tomcat’s own version tool, which reads the JARs on disk and so also catches tarball installs. It does not prove the running JVM has loaded them, which is why every upgrade below ends with a restart. The version.sh script sits under /usr/share/tomcat10/bin/ on Debian and Ubuntu, and RHEL wraps it as /usr/sbin/tomcat version:

sudo /usr/share/tomcat10/bin/version.sh | grep -E 'Server (version|number)|JVM Version|OS Name'

Ubuntu appends its own tag to the version line, and the JVM line confirms which OpenJDK Tomcat runs on:

Server version: Apache Tomcat/10.1.16 (Ubuntu)
Server number:  10.1.16.0
OS Name:        Linux
JVM Version:    21.0.13.1+2-1-24.04.1-Ubuntu

That JVM build matters for a separate reason: 21.0.13.1+2 is the minimum OpenJDK 21 build that closes Java4Shell, CVE-2026-114938, so check it while you are on the box. The capture below puts the package list, the running version and the pending candidate side by side on the Ubuntu 24.04 host.

Checking the installed tomcat10 version, apt candidate and pro fix dry run for CVE-2026-76183 on Ubuntu 24.04

Next, find out whether anything on the server registers a WebSocket endpoint at all. Compiled endpoint classes reference the Jakarta WebSocket server annotations by name, so a recursive grep over the webapps directory finds them without starting a scanner. Use javax/websocket in the pattern for Tomcat 9 applications.

sudo grep -rlE --include='*.class' 'jakarta/websocket/server/ServerEndpoint|jakarta/websocket/server/ServerApplicationConfig' /var/lib/tomcat11/webapps/ /usr/share/tomcat11-examples/ 2>/dev/null | head

On the Ubuntu 26.04 host the only hits came from the examples package, which ships echo, chat and snake demos.

/usr/share/tomcat11-examples/examples/WEB-INF/classes/websocket/ExamplesConfig.class
/usr/share/tomcat11-examples/examples/WEB-INF/classes/websocket/chat/ChatAnnotation.class
/usr/share/tomcat11-examples/examples/WEB-INF/classes/websocket/echo/EchoAnnotation.class
/usr/share/tomcat11-examples/examples/WEB-INF/classes/websocket/echo/EchoStreamAnnotation.class
/usr/share/tomcat11-examples/examples/WEB-INF/classes/websocket/snake/SnakeAnnotation.class

This pattern finds annotated and config-class endpoints. Frameworks such as Spring register endpoints in code through ServerContainer.addEndpoint(), and the unanchored ServerEndpoint match also catches their ServerEndpointConfig references. Classes packed inside JAR files under WEB-INF/lib won’t match a plain grep, so ask the developers which apps open sockets if your applications ship as libraries. Remove tomcat11-examples or tomcat-webapps from any production server either way; demo apps don’t belong there. For the realm check, look for a JNDIRealm and its authentication attribute. On Debian and Ubuntu the config lives in /etc/tomcat10/ or /etc/tomcat11/, and on RHEL and Amazon Linux in /etc/tomcat/:

sudo grep -rnE -A4 'realm\.JNDIRealm' /etc/tomcat11/ | grep -E 'JNDIRealm|authentication='

We seeded the Debian 13 host with a realm that uses DIGEST-MD5, which is the exposed shape:

/etc/tomcat11/server.xml:127:        <Realm className="org.apache.catalina.realm.JNDIRealm"
/etc/tomcat11/server.xml-130-               authentication="DIGEST-MD5" />

No output means no JNDI realm in the main config. Repeat the grep over each application’s META-INF/context.xml, since a realm can be declared per app there.

Ubuntu 26.04 and 24.04: the standard security pocket

Canonical shipped both fixes in USN-9186-1 on 23 November 2026, in the normal security pocket, so no Ubuntu Pro subscription is needed for tomcat10 or tomcat11. The pro fix command is a convenient check, with one catch we hit in the lab. Run with --dry-run, it prints the upgrade it would perform and then still ends with “CVE-2026-76183 is resolved”, which is false: nothing was installed. Trust the package version, not that last line.

sudo apt update
sudo apt-get install --only-upgrade -y libtomcat10-java tomcat10 tomcat10-common

The upgrade also pulls in tomcat-jakartaee-migration as a new dependency on 24.04. Restart the service yourself so you know the new JARs are loaded, then check the installed version:

sudo systemctl restart tomcat10
systemctl is-active tomcat10
sudo /usr/share/tomcat10/bin/version.sh | grep -E 'Server (version|number)'

The service is back and the installed server reports the fixed upstream release:

active
Server version: Apache Tomcat/10.1.61 (Ubuntu)
Server number:  10.1.61.0

For an audit trail, apt changelog tomcat10 | grep -nE 'CVE-2026-(76183|101296)' shows both CVE IDs in the Ubuntu changelog, and a real (not dry) pro fix CVE-2026-76183 answers “The update is already installed.” The capture shows the full sequence on the 24.04 host.

Upgrading tomcat10 to 10.1.61 on Ubuntu 24.04, restarting it and confirming both Tomcat CVEs in the changelog

Ubuntu 26.04 ships tomcat11 as well as tomcat10, and our 26.04 host ran the 11.0.18 release build with the admin and examples packages. Upgrade every tomcat11 package you have installed in the same command, since a mismatched libtomcat11-java leaves the old classes on the classpath:

sudo apt-get install --only-upgrade -y libtomcat11-java tomcat11 tomcat11-admin tomcat11-common tomcat11-examples
sudo systemctl restart tomcat11

After the restart version.sh reported 11.0.27, which carries both fixes, and pro fix CVE-2026-101296 confirmed it:

Tomcat 11 on Ubuntu 26.04 upgraded from 11.0.18 to 11.0.27 with pro fix reporting CVE-2026-101296 resolved

If you run tomcat9 on any Ubuntu release, you have no package to install. Canonical lists it as needing evaluation for both CVEs, so apply the stopgaps further down or move the apps to tomcat10. Hosts built from our Ansible Tomcat role for Ubuntu, Rocky Linux and Debian use an upstream tarball instead; bump the version variable to 10.1.61 or later and rerun the play.

Debian 12 and 13: no fixed package yet

Debian stable is the release where you have to do the most thinking. On the Debian 12 host, tomcat10 10.1.55-1~deb12u1 upgraded to 10.1.60-1~deb12u1 from bookworm-security. Upstream 10.1.60 contains the code fix for CVE-2026-76183, yet the Debian changelog for that build lists nineteen other Tomcat CVEs and not this one, and debsecan kept flagging both CVEs after the upgrade:

debsecan --suite bookworm 2>/dev/null | grep -E 'CVE-2026-(76183|101296)'

Every Tomcat binary package still appears against both IDs, before and after the update:

CVE-2026-101296 libtomcat10-java
CVE-2026-76183 libtomcat10-java
CVE-2026-101296 tomcat10
CVE-2026-76183 tomcat10
CVE-2026-101296 tomcat10-common
CVE-2026-76183 tomcat10-common

Our reading: 10.1.60 most likely closes the WebSocket bypass in code, but Debian has not confirmed it, and CVE-2026-101296 definitely needs 10.1.61, which bookworm does not have. Install the 10.1.60 update anyway, because it closes the other nineteen CVEs, then treat the host as exposed to both and apply the stopgaps. The capture shows the whole sequence on the bookworm host.

debsecan on Debian 12 still listing both Tomcat CVEs after tomcat10 moves from 10.1.55 to 10.1.60

Debian 13 has even less to offer right now. The trixie host ran tomcat11 11.0.22-1~deb13u1, apt-get -s upgrade had no Tomcat update pending, and debsecan --suite trixie listed both CVEs against tomcat11, tomcat11-common and libtomcat11-java. The trixie tomcat10 build, 10.1.60-1~deb13u1, is in the same position as bookworm’s. Only forky and sid carry fixed builds, and mixing testing packages into a stable production server trades one risk for another. Watch the tracker, apply the stopgaps, and plan the move to a fixed point release when it lands.

RHEL 10: an advisory that hides one of its CVEs

RHEL 10.3 gets both fixes in RHSA-2026:104827, which moves tomcat to 10.1.61. The catch is in the advisory metadata: it references CVE-2026-76183 but not CVE-2026-101296. Anyone patching by CVE ID will conclude the realm bug has no fix, which is exactly what the lab host told us:

sudo dnf -q updateinfo list --cve CVE-2026-76183
sudo dnf -q updateinfo list --cve CVE-2026-101296
sudo dnf upgrade --cve CVE-2026-101296 --assumeno

The first query returns the six RHSA-2026:104827 packages. The second returns nothing at all, and the CVE-keyed upgrade refuses to act on a host running vulnerable 10.1.49:

No security updates needed, but 31 updates available
Dependencies resolved.
Nothing to do.
Complete!

If your patch tooling, Satellite content view or compliance report keys on CVE IDs, it will mark CVE-2026-101296 as not applicable until Red Hat updates the erratum. The capture shows the gap as the lab host reported it.

RHEL 10.3 dnf updateinfo listing RHSA-2026:104827 for CVE-2026-76183 but nothing for CVE-2026-101296

Patch by advisory instead, which installs the same build regardless of which CVEs the metadata names:

sudo dnf upgrade -y --advisory RHSA-2026:104827
sudo systemctl restart tomcat
rpm -q tomcat

Don’t skip the restart. Tomcat keeps the old classes in memory until the JVM stops, so a host can carry the new RPM and still serve the vulnerable code. The package query should name the el10_3 build:

tomcat-10.1.61-1.el10_3.noarch

Proof that the realm fix is in the build comes from the RPM changelog, which lists both CVEs even though the advisory lists one:

rpm -q --changelog tomcat | grep -B1 -E 'CVE-2026-(76183|101296)'

Both entries appear, with the RHEL Jira reference on the WebSocket fix:

- Resolves: RHEL-272542
  tomcat: Authentication Bypass in WebSocket Endpoints (CVE-2026-76183)
--
- Resolves:
  tomcat: JNDIRealm bind credential validation fails open for non-GSSAPI SASL mechanisms (CVE-2026-101296)

Tomcat came back active and /usr/sbin/tomcat version reported 10.1.61 after the restart. The capture shows the upgrade, restart and changelog check together.

Applying RHSA-2026:104827 on RHEL 10.3 and confirming tomcat 10.1.61 with both CVEs in the rpm changelog

EUS subscribers on RHEL 10.2 and 10.0 get RHSA-2026:104826 (tomcat-1:10.1.61-1.el10_2) and RHSA-2026:104828 (tomcat-1:10.1.61-1.el10_0). Unlike RHSA-2026:104827, both of those appear in Red Hat’s VEX data as the fix for CVE-2026-101296 as well as CVE-2026-76183. RHEL 9.9 moves tomcat to 9.0.123 in RHSA-2026:104856, which contains both upstream fixes, but Red Hat’s CVE-2026-101296 record does not list that advisory, so the same --cve gap applies on RHEL 9. Patch with --advisory RHSA-2026:104856 and confirm both IDs in rpm -q --changelog tomcat. RHEL 8 tomcat is still listed as affected with no fix, as is the separate tomcat9 package on RHEL 10. AlmaLinux 10 and Rocky Linux 10 had not rebuilt RHSA-2026:104827 when we checked, so hosts set up from our Tomcat install guide for Rocky Linux and Fedora need the stopgaps for now. When the rebuild lands, check whether its metadata names both CVEs before you trust a CVE-keyed upgrade there.

Amazon Linux 2023 and the release lock

Amazon Linux 2023 pins each instance to the repository snapshot of the AMI it booted from. An instance launched from an older AMI sees neither the fix nor the advisory, so security scanning on the box reports a clean bill of health. Our old-AMI instance ran tomcat10 10.1.59 on release 2023.12.20260930, and both standard checks came back empty:

sudo dnf -q updateinfo list --cve CVE-2026-76183
sudo dnf upgrade --security --assumeno

The first prints nothing, and the second ends with “Nothing to do.” The fix exists in a newer release, which dnf check-release-update reveals, and querying against that release shows both advisories:

sudo dnf -q updateinfo list --releasever=2023.12.20261127 --cve CVE-2026-76183 --cve CVE-2026-101296

ALAS2023-2026-3165 carries the WebSocket fix at 10.1.60 and ALAS2023-2026-3420 the realm fix at 10.1.61 (output trimmed to the main package):

ALAS2023-2026-3165 Important/Sec. tomcat10-1:10.1.60-1.amzn2023.0.1.noarch
ALAS2023-2026-3420 Important/Sec. tomcat10-1:10.1.61-1.amzn2023.0.1.noarch

You have two ways to install it. Moving the whole instance to the new release with sudo dnf upgrade --releasever=2023.12.20261127 is the cleaner path, since it also brings every other fix from the newer snapshot. If your change window only covers Tomcat, scope the release override to the package, which leaves system-release on the old snapshot:

sudo dnf upgrade -y --releasever=2023.12.20261127 tomcat10
sudo systemctl restart tomcat10
rpm -q tomcat10 system-release

Tomcat is fixed while the release marker stays behind, which is why the next security scan on this instance will still look at the old snapshot.

tomcat10-10.1.61-1.amzn2023.0.1.noarch
system-release-2023.12.20260930-0.amzn2023.noarch

The capture below runs the whole sequence on the old-AMI instance, from the empty CVE query to the fixed package.

Amazon Linux 2023 instance locked to 2023.12.20260930 seeing no Tomcat fix until dnf is run with releasever

Instances launched from the 2023.12.20261127 AMI need no override. That release offers tomcat9 9.0.123, tomcat10 10.1.61 and tomcat11 11.0.29, all past both fixes, and the tomcat11 advisories (ALAS2023-2026-3151 and ALAS2023-2026-3488) carry their CVE references, as do the tomcat9 pair (ALAS2023-2026-3166 at 9.0.122 and ALAS2023-2026-3472 at 9.0.123), so dnf upgrade --cve works there. Rebuild launch templates and Auto Scaling groups on the new AMI, or replacement instances will come up vulnerable.

Amazon Linux 2: tomcat 7.0.76 and the tomcat9 topic

Amazon Linux 2 still ships tomcat 7.0.76 in its core repository, with fixes backported into the amzn2 release number. Here the CVE metadata is complete, and yum updateinfo list cves on our host running 7.0.76-10.amzn2.0.17 showed the WebSocket fix in .19 (ALAS2-2026-4019) and the realm fix in .20 (ALAS2-2026-4089). The CVE-keyed command found it too:

sudo yum update --cve CVE-2026-101296 --assumeno

It selected the five Tomcat packages and the .20 build. Unlike RHEL 10, the CVE-keyed path works here because each ALAS2 entry lists its CVE IDs, so patch tooling that filters by CVE will pick it up:

5 package(s) needed (+0 related) for security, out of 5 available
 tomcat                   noarch   7.0.76-10.amzn2.0.20      amzn2-core    95 k

We applied it by advisory, then rechecked that neither CVE is still pending:

sudo yum update -y --advisory ALAS2-2026-4089
sudo systemctl restart tomcat
sudo yum -q updateinfo list cves | grep -cE 'CVE-2026-(76183|101296)'

The count dropped to 0 and rpm -q tomcat reported 7.0.76-10.amzn2.0.20:

Amazon Linux 2 yum updateinfo listing both Tomcat CVEs and ALAS2-2026-4089 upgrading tomcat to 7.0.76-10.amzn2.0.20

Hosts on the tomcat9 extras topic get their package from amzn2extra-tomcat9, which offered 9.0.123-1.amzn2.0.1 in the lab, past both fixes. Amazon tracks that topic under its own advisory series, ALAS2TOMCAT9-2026-029 for the WebSocket fix and ALAS2TOMCAT9-2026-030 for the realm fix. Run sudo yum update tomcat on those. Treat the 7.0.76 package as a bridge, not a home: Tomcat 7.0 left upstream support years ago, so every fix for it depends on Amazon backporting the patch.

Stopgaps for hosts that cannot update

Debian stable, Ubuntu tomcat9, RHEL 8, the RHEL 10 tomcat9 package and the AlmaLinux and Rocky Linux 10 rebuilds have no fixed package yet. Apache publishes no workaround for CVE-2026-76183, so the only control that holds is refusing WebSocket upgrades outright, and that breaks every app that depends on them. Use it on hosts where the earlier grep found no endpoint you need, or where an outage of live features beats an auth bypass.

Refusing WebSocket upgrades with RewriteValve

Tomcat’s built-in RewriteValve can return 403 for a WebSocket handshake before it reaches an application. Back up server.xml first, then find the line that closes the opening Host tag:

sudo cp /etc/tomcat11/server.xml /etc/tomcat11/server.xml.orig
sudo grep -n "<Host name" -A2 /etc/tomcat11/server.xml

On the stock Ubuntu 26.04 file the tag spans lines 135 and 136, so the valve goes after 136. Other packages and edited files put it elsewhere, so use the number your own grep prints in the sed below, and add the valve to every Host block if you run more than one:

135:      <Host name="localhost"  appBase="webapps"
136-            unpackWARs="true" autoDeploy="true">
137-

Insert the valve after that line, then write the rule file the valve reads from the host’s config directory. Our first version of the rule matched the Upgrade header case-insensitively and forbade the request:

sudo sed -i '136a\        <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />' /etc/tomcat11/server.xml
printf 'RewriteCond %%{HTTP:Upgrade} ^websocket$ [NC]\nRewriteRule ^/.* - [F]\n' | sudo tee /etc/tomcat11/Catalina/localhost/rewrite.config
sudo chown root:tomcat /etc/tomcat11/Catalina/localhost/rewrite.config
sudo chmod 640 /etc/tomcat11/Catalina/localhost/rewrite.config
sudo systemctl restart tomcat11

Prove it from the server itself with a handshake request against a known endpoint. Before the change the examples echo endpoint answered HTTP/1.1 101, the switch to WebSocket:

curl -s -i -m 3 -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" http://127.0.0.1:8080/examples/websocket/echoAnnotation | head -1

With the valve and that first rule loaded, the handshake was refused while ordinary pages kept working:

HTTP/1.1 403 

A plain curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:8080/examples/ still returned 200. The capture shows that first rule before and after on the Ubuntu 26.04 host.

Tomcat RewriteValve on Ubuntu 26.04 turning a WebSocket upgrade from 101 into 403 while normal pages still return 200

Do not stop at that rule. Our review of Tomcat’s source found a gap in it, and a second lab run confirmed it. The %{HTTP:Upgrade} lookup reads only the first Upgrade header as one string, while Tomcat’s WebSocket filter accepts the handshake when any comma-separated token in any Upgrade header is websocket. With the first rule loaded, a handshake sending Upgrade: h2c, websocket still got HTTP/1.1 101. Every handshake Tomcat accepts must carry exactly one valid Sec-WebSocket-Key header, so key the condition on that header instead and overwrite the rule file. Mind the pattern: RewriteValve matches a condition against the whole value, not a substring, so a lone . would only match a one-character key and let every real 24-character key through. Use .+:

printf 'RewriteCond %%{HTTP:Sec-WebSocket-Key} .+\nRewriteRule ^/.* - [F]\n' | sudo tee /etc/tomcat11/Catalina/localhost/rewrite.config
sudo systemctl restart tomcat11

Repeat the handshake curl afterwards, once as shown above and once with -H "Upgrade: h2c, websocket" in place of the plain header. A one-line loop does both and then checks a normal page:

for U in "websocket" "h2c, websocket"; do echo "Upgrade: $U"; curl -s -i -m 3 -H "Connection: Upgrade" -H "Upgrade: $U" -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" http://127.0.0.1:8080/examples/websocket/echoAnnotation | head -1; done; curl -s -o /dev/null -w "/examples/ %{http_code}\n" http://127.0.0.1:8080/examples/

On our Ubuntu 26.04 host the hardened rule refused both handshakes and left the examples app alone:

Upgrade: websocket
HTTP/1.1 403
Upgrade: h2c, websocket
HTTP/1.1 403
/examples/ 200

Both lines must read 403 and /examples/ must stay at 200 before you count the host as covered. The capture below runs the first rule and the hardened one back to back, so the 101 that slipped through and the 403 that replaced it sit on one screen. The source behind the gap is Tomcat’s UpgradeUtil class, which performs the token check.

Tomcat 11 on Ubuntu 26.04: the Upgrade-header rule lets an h2c, websocket handshake through with 101, while the Sec-WebSocket-Key rule returns 403 for both and /examples/ stays 200

Remove the stopgap once the fixed package is in, or the first app team to add a WebSocket feature will lose an afternoon to a mystery 403. Restore the backup, delete the rule file and restart. In our lab the echo endpoint went back to 101 straight away. If a reverse proxy fronts Tomcat, the same refusal can live there instead, which keeps server.xml untouched.

sudo cp /etc/tomcat11/server.xml.orig /etc/tomcat11/server.xml
sudo rm /etc/tomcat11/Catalina/localhost/rewrite.config
sudo systemctl restart tomcat11

Run the handshake curl again after the restart so you know the rollback took effect. A 101 means WebSocket traffic flows again, which is only safe once the version check shows a fixed build.

Taking the JNDIRealm off SASL

CVE-2026-101296 has a clean workaround: stop using a non-GSSAPI SASL mechanism. Switch the realm to simple binds, and move the connection to LDAPS at the same time, because a simple bind over plain LDAP sends the password in clear text. That is a worse problem than the one you are fixing. Swap in your own directory URL for the example ldap.example.com one; if the second expression doesn’t match your file, it silently changes nothing. On the Debian 13 host:

sudo sed -i -e 's#authentication="DIGEST-MD5"#authentication="simple"#' -e 's#ldap://ldap.example.com:389#ldaps://ldap.example.com:636#' /etc/tomcat11/server.xml
sudo systemctl restart tomcat11

Rerun the grep with the connection URL included to confirm both attributes changed:

sudo grep -nE -A4 'realm\.JNDIRealm' /etc/tomcat11/server.xml | grep -E 'connectionURL|authentication='

The realm now binds with a simple bind over port 636:

128-               connectionURL="ldaps://ldap.example.com:636"
130-               authentication="simple" />

The Tomcat JVM must trust the directory’s CA certificate for LDAPS to connect, so test a real login before you close the change. If Kerberos is already in your estate, GSSAPI is the other unaffected option. The detection, the edit and the restart on trixie:

Debian 13 tomcat11 with no fix pending, a JNDIRealm using DIGEST-MD5 found by grep and switched to simple over ldaps

Keep the Manager and Host Manager apps bound to localhost or a management network as well. Those are the apps a realm bypass would open first, and on Debian and Ubuntu they come from the separate tomcat10-admin or tomcat11-admin package, so uninstalling it is often the quickest win.

Tomcat checks to close the change window

A patched package proves little until the running JVM has loaded it. Work through these on every Tomcat host before you mark the ticket done:

  1. The installed server reports 9.0.123, 10.1.61, 11.0.27 or later, or a distro build listed as fixed above.
  2. Tomcat was restarted after the upgrade, its ActiveEnterTimestamp in systemctl show is later than the package install, and systemctl is-active reads active.
  3. On RHEL 10, rpm -q --changelog tomcat lists both CVE IDs, whatever dnf updateinfo says.
  4. On Amazon Linux 2023, launch templates point at the 2023.12.20261127 AMI or newer.
  5. No JNDIRealm uses a SASL mechanism other than GSSAPI, in server.xml or any context.xml.
  6. Unpatched hosts refuse WebSocket handshakes with 403, or have no WebSocket endpoint deployed.
  7. The examples and admin webapps are absent from production servers.
  8. Tarball installs under /opt and Tomcat bundled inside vendor products were checked with version.sh, not only the package manager.

The last item is where we expect most stragglers. Package managers patch what they installed, while embedded Tomcat inside Spring Boot jars and appliance software follows its vendor’s schedule. Note those hosts in the ticket by name. Same-week Tomcat and OpenJDK fixes are common, so check the JDK too; on Ubuntu our OpenJDK install guide for Ubuntu 26.04 covers switching between the packaged JDKs. For the same patch workflow on other stacks, see the PHP2Shell check and patch guide.

Keep reading

Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs Security Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch Security nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch WP Rocket CVE-2026-125812: Check, Patch and Hunt Planted Files Security WP Rocket CVE-2026-125812: Check, Patch and Hunt Planted Files Enable Post-Quantum TLS in Nginx, Apache, HAProxy and OpenSSH Security Enable Post-Quantum TLS in Nginx, Apache, HAProxy and OpenSSH Enable SSL Encryption and SCRAM-SHA-256 Password Authentication in PostgreSQL CentOS Enable SSL Encryption and SCRAM-SHA-256 Password Authentication in PostgreSQL

Leave a Comment

Press ESC to close