How To

Disable HTTP/2 in Apache to Mitigate CVE-2026-119618

On 11 November 2026, the Apache team disclosed CVE-2026-119618 in mod_http2. A race in the code that assigns response headers corrupts the heap, so the project rates it critical and Red Hat scores it CVSS 9.8, because it can end in remote code execution. Upstream shipped the fix the same day. A day later, Ubuntu still had no updated apache2 package and Rocky Linux 9 was still serving the vulnerable mod_http2 build, so check the CVE-2026-119618 patch status for your distro first.

Original content from computingforgeeks.com - post 189523

If you cannot patch yet, you can still close the hole. The Red Hat CVE page says it plainly, servers configured to serve only HTTP/1.1 are not vulnerable. This guide turns HTTP/2 off the Debian way and the RHEL way, proves the result with curl and nghttp, measures what you give up, and shows how to switch it back on. We ran every step in November 2026 on Ubuntu 24.04, Ubuntu 26.04 and Rocky Linux 9 with SELinux enforcing, probing from a separate client with nginx in front.

The three conditions behind the exposure

A host is exposed only when all three of these conditions hold at once, so check each one before you decide how urgent your fleet is:

  • The Apache build or the standalone mod_h2 sits in the affected range.
  • The http2_module shows up in apache2ctl -M or httpd -M.
  • An active Protocols line offers h2 or h2c to the server or to a vhost.

Break any one of them and the vulnerable code never sees a request. You cannot change the first until a fixed package exists, so mitigation means breaking the second or third condition, and doing it in a way the next package update will not quietly reverse. One more detail from the mod_http2 source: the module refuses to run under the prefork MPM, so an Ubuntu host on prefork for mod_php does not serve HTTP/2 even with the module loaded. The probe below settles it either way.

ComponentAffectedFixed
Apache HTTP Server2.4.55 through 2.4.702.4.71 (released 2026-11-11)
mod_h2 from GitHub2.0.8 through 2.0.42Later releases
RHEL 9 mod_http2Earlier builds2.0.26-7.el9_9.1 (RHSA-2026:98981)
RHEL 10 mod_http2Earlier builds2.0.29-5.el10_3.1 (RHSA-2026:98978)
RHEL 8 and earlierNot affectedNot applicable

The range comes from the Apache httpd 2.4 vulnerability list, and the RHEL builds come from the Red Hat CVE page. The defaults on the three distros we tested are not the same, and that matters more than the version number when you decide how urgent this is:

  • Ubuntu 24.04 and 26.04 ship apache2 with the http2 module disabled; it is exposed once someone runs a2enmod http2, because the module config http2.conf sets Protocols h2 h2c http/1.1 server-wide.
  • Rocky Linux 9 loads http2_module from 10-h2.conf on install but sets no Protocols line, so it speaks HTTP/1.1 until a config file adds h2.
  • Any vhost with its own Protocols h2 ... line is exposed on every distro while the module is loaded.

Many guides, including ours, tell you to enable HTTP/2 during setup, so assume the module is on until the audit below says otherwise. Upstream ships no workaround text with the advisory, which is why the probes later in this guide matter: they are your only proof that the mitigation took.

Every place HTTP/2 can be switched on

Start with what Apache actually loaded, not what you remember configuring. On Ubuntu, check the version, confirm the module, then search only the files Apache reads: the main config and the three *-enabled directories. Searching *-available as well floods you with lines that aren’t active.

apache2 -v
sudo apache2ctl -M 2>/dev/null | grep -i http2
grep -Rn -e "^\s*Protocols" -e "^\s*H2" /etc/apache2/apache2.conf /etc/apache2/mods-enabled /etc/apache2/conf-enabled /etc/apache2/sites-enabled

On the Ubuntu 24.04 lab host the module was loaded and two lines offered HTTP/2. The first comes from the config file that ships with the module, and the second from a vhost that sets its own list.

Server version: Apache/2.4.58 (Ubuntu)
Server built:   2026-10-16T01:03:15
 http2_module (shared)
/etc/apache2/mods-enabled/http2.conf:1:Protocols h2 h2c http/1.1
/etc/apache2/sites-enabled/app.conf:4:    Protocols h2 http/1.1

The same audit in the terminal, run as the lab user on web-lab01. Ubuntu 26.04 returned the same two lines with Apache 2.4.66:

Ubuntu 24.04 Apache audit showing http2_module loaded and Protocols h2 lines in http2.conf and a vhost

Write down every file the grep returns, so you know which lines to recheck after the change. The h2c entry in http2.conf is the one people miss: it lets HTTP/2 run on plain port 80 too, so a host that only terminates TLS somewhere else is still reachable on the cleartext side.

On Rocky Linux and other EL hosts, the module is loaded from conf.modules.d and the Protocols lines live wherever an admin put them. Search the three config trees and skip /etc/httpd/modules, which is a symlink to binary files:

rpm -q httpd mod_http2 && getenforce
sudo httpd -M 2>/dev/null | grep http2
sudo grep -Rn -e "^\s*Protocols" -e "^\s*H2" /etc/httpd/conf /etc/httpd/conf.d /etc/httpd/conf.modules.d; echo "exit=$?"

A fresh Rocky 9 install loads both HTTP/2 modules, yet the grep finds no Protocols line and exits 1:

httpd-2.4.62-13.el9_8.9.x86_64
mod_http2-2.0.26-6.el9_8.2.x86_64
Enforcing
 http2_module (shared)
 proxy_http2_module (shared)
exit=1

That host answers HTTP/1.1 only, which our probe confirmed. To reproduce the common case, we then added Protocols h2 h2c http/1.1 in /etc/httpd/conf.d/http2.conf, a file no package owns, and the same probe reported HTTP/2 on all three paths. Check conf.d for exactly that kind of file.

A probe that shows what the server negotiates

Config files tell you intent, and the handshake tells you the truth. Run this probe from another machine, never from the server itself, because a proxy or firewall in between changes the answer. A clean result needs three rows to come back without HTTP/2:

  • ALPN over TLS on port 443, for the origin IP and for each vhost name.
  • An Upgrade: h2c request on plain port 80.
  • h2c with prior knowledge on port 80, which skips the upgrade.

Most checks people run stop at the first row, which is why h2c survives so many hardening passes. The rows need curl built with HTTP/2 support (curl -V lists HTTP2 under Features), and the nghttp and h2load tools used later come from the nghttp2-client package on Ubuntu. Create the script on the client:

sudo vim /usr/local/bin/h2-probe.sh

Paste the script below. Each row prints the HTTP version curl ended up using; 0 means the connection failed:

#!/usr/bin/env bash
# Usage: h2-probe.sh <origin-ip> [vhost-name ...]
ip="$1"; shift
row() { printf '%-5s %s\n' "$2" "$1"; }
row "https://$ip/ (TLS, ALPN)" "$(curl -sk --http2 -o /dev/null -w '%{http_version}' "https://$ip/")"
for vh in "$@"; do
  row "https://$vh/ (TLS, ALPN)" "$(curl -sk --http2 --resolve "$vh:443:$ip" -o /dev/null -w '%{http_version}' "https://$vh/")"
done
row "http://$ip/ (Upgrade: h2c)" "$(curl -s --http2 -o /dev/null -w '%{http_version}' "http://$ip/")"
row "http://$ip/ (prior knowledge)" "$(curl -s --http2-prior-knowledge -o /dev/null -w '%{http_version}' "http://$ip/")"

Make it executable, then point it at the origin’s address and every vhost name that has its own Protocols line. The --resolve flag sends the right SNI without touching DNS:

sudo chmod 755 /usr/local/bin/h2-probe.sh
h2-probe.sh 10.0.1.50 app.example.com

Before any change, both Ubuntu hosts negotiated HTTP/2 on every path. The verbose curl run underneath shows what h2c looks like on the wire: a normal HTTP/1.1 request, a 101 Switching Protocols, then HTTP/2 on the same connection.

h2-probe.sh output showing HTTP/2 negotiated over TLS, h2c upgrade and prior knowledge before the mitigation

Keep this output. It is the baseline you compare against after the change, and a row that still says 2 afterwards is a path you missed. If you’d rather see the ALPN result from a dedicated HTTP/2 client, nghttp -nv https://10.0.1.50/ printed The negotiated protocol: h2 on the same host.

Two fixes that look right and are not

The first instinct is to drop a server-wide Protocols http/1.1 into a new conf file. We tried exactly that on Ubuntu 24.04, and nothing changed. The Protocols directive documentation says a line inside a vhost replaces the base server’s list, and in our runs a second line at the server level did not replace http2.conf‘s list either:

echo "Protocols http/1.1" | sudo tee /etc/apache2/conf-available/no-h2.conf
sudo a2enconf no-h2 && sudo apache2ctl configtest && sudo systemctl reload apache2

Apache accepted the file, and the probe from the client still read HTTP/2 everywhere:

2     https://10.0.1.50/ (TLS, ALPN)
2     https://app.example.com/ (TLS, ALPN)
2     http://10.0.1.50/ (Upgrade: h2c)
2     http://10.0.1.50/ (prior knowledge)

Even if that line had won at the server level, app.example.com carries its own Protocols h2 http/1.1, and a vhost list is never overridden from outside. Do not ship this as your mitigation. Remove the file with sudo a2disconf no-h2 so it doesn’t mislead the next person reading the config.

The second trap is H2Upgrade off plus H2Direct off. The mod_http2 docs describe them as controls for the h2c upgrade and for direct HTTP/2 on a connection, and that’s all they do. With both set server-wide, the cleartext paths closed and TLS kept negotiating HTTP/2:

With H2Upgrade off and H2Direct off, h2c is closed but HTTP/2 over TLS is still negotiated

Port 443 is where the internet reaches you, so this leaves the exposure in place. Both directives only decide how a connection may switch to HTTP/2, and ALPN negotiation during the TLS handshake never asks them. Treat them as tidying for h2c, not as a CVE control.

Ubuntu and Debian control: a2dismod http2

Unloading the module is the control that holds, because no Protocols line can offer a protocol Apache no longer has. The core docs say protocol names that are unavailable are simply ignored, so vhosts that still list h2 keep working on HTTP/1.1 with no edits:

sudo a2dismod http2
sudo apache2ctl configtest && sudo systemctl restart apache2
sudo apache2ctl -M 2>/dev/null | grep -c http2_module

The count must read 0, because a module that is not loaded cannot parse a single HTTP/2 frame. On both Ubuntu hosts the config test passed with the h2 line in the vhost untouched. Nothing else in the config needed to change:

Module http2 disabled.
To activate the new configuration, you need to run:
  systemctl restart apache2
Syntax OK
0

A graceful systemctl reload apache2 also dropped HTTP/2 in our test on Ubuntu 26.04, which helps on a busy server. We still prefer a restart during a quiet minute, since it guarantees no old child process keeps the module mapped.

Run the probe again from the client. Every TLS and upgrade path now answers HTTP/1.1, prior knowledge fails outright, and nghttp refuses to continue because the server never selected h2:

Probe after a2dismod http2 showing HTTP/1.1 on every path and nghttp reporting HTTP/2 protocol was not selected

That is the result you want on every host: no 2 in the first column. The curl exit code 56 on the prior knowledge row means the server read the HTTP/2 preface as a broken HTTP/1.1 request and closed the connection, which is the correct behaviour.

ERROR: The following modules depend on http2 and need to be disabled first: proxy_http2

Hosts that reverse proxy to an HTTP/2 backend have proxy_http2 enabled, and the Debian file proxy_http2.load declares Depends: proxy http2. On Ubuntu 26.04 a2dismod http2 refused and exited 1 until we named both modules in one call:

a2dismod http2 refusing because proxy_http2 depends on it, then both modules disabled on Ubuntu 26.04

Disabling proxy_http2 breaks any ProxyPass that uses an h2:// or h2c:// backend, so look through your enabled sites for those backend schemes first. If you find some, use the alternative below instead.

Keeping the module loaded with an HTTP/1.1 list

When the module has to stay, rewrite every active Protocols line to http/1.1: the one in http2.conf and the one in each vhost. On Ubuntu 26.04 a single sed covered both files we found in the audit:

sudo sed -i "s/^\(\s*\)Protocols .*/\1Protocols http\/1.1/" /etc/apache2/mods-available/http2.conf /etc/apache2/sites-available/app.conf
grep -Rn "^\s*Protocols" /etc/apache2/mods-enabled /etc/apache2/sites-enabled
sudo apache2ctl configtest && sudo systemctl reload apache2

Both modules stayed loaded and the probe read 1.1, 1.1, 1.1 and 0, the same as after a2dismod. We rank this second for two reasons. A new vhost copied from an old template can quietly bring h2 back, and http2.conf is a package conffile, so an apache2 upgrade that also changes that file will stop and ask whether to keep your edit.

Rocky Linux control: comment out the LoadModule line

On EL hosts there’s no a2dismod, so you stop httpd loading the module. Comment out the line in 10-h2.conf instead of deleting or renaming the file; the next section shows why. If the same hosts run PHP, the PHP2Shell fix for RHEL, Rocky and AlmaLinux is worth doing in the same maintenance window:

sudo sed -i "s/^LoadModule http2_module/#LoadModule http2_module/" /etc/httpd/conf.modules.d/10-h2.conf
sudo httpd -t
sudo systemctl restart httpd

With SELinux enforcing, httpd restarted cleanly and httpd -M listed only proxy_http2_module. The conf.d file that still says Protocols h2 h2c http/1.1 passed the syntax check, for the same reason as on Ubuntu. Reinstalling the package left the comment in place:

Rocky Linux 9 with SELinux enforcing: http2_module LoadModule commented out and the change surviving dnf reinstall

The probe against the Rocky host then read 1.1, 1.1 and 0. On Rocky 9, mod_proxy_http2 loaded and httpd started without mod_http2, so we left 10-proxy_h2.conf alone; comment it out as well if nothing on the host proxies to an HTTP/2 backend.

Renaming 10-h2.conf gets undone by dnf

Renaming the file to 10-h2.conf.disabled works at first, because httpd includes only *.conf. The file is listed by rpm -qc mod_http2 as a config file, though, and rpm restores config files that have gone missing. One dnf reinstall put a fresh copy next to the renamed one:

dnf reinstall mod_http2 recreating 10-h2.conf next to the renamed 10-h2.conf.disabled file on Rocky Linux 9

After the restart, the probe was back to HTTP/2 on all three paths. Nobody notices this until an unrelated update or a config management run reinstalls the package, which is exactly how a mitigation dies quietly. The commented line survives because rpm keeps a modified config file in place.

Removing the package is the other clean option. rpm -q --whatrequires mod_http2 returned no package requires mod_http2, and dnf remove --assumeno mod_http2 showed it would remove only that package. That also takes mod_proxy_http2 with it, and you’ll have to install the fixed build on purpose later.

What HTTP/1.1 costs you

Turning off HTTP/2 costs page speed, not correctness, and the size of the hit depends on latency. We measured it with h2load from the client against the Ubuntu 24.04 origin over TLS. The test fetched a page of 41 objects: the index plus 40 stylesheets of about 8 KB each. HTTP/2 used one connection with all 41 streams open, and HTTP/1.1 used six connections, the way a browser does. Delay toward the client came from tc netem, and each figure is the median of five runs:

h2load -n 41 -c 1 -m 41 -i page-uris.txt
h2load --h1 -n 41 -c 6 -m 1 -i page-uris.txt

At 100 ms of round trip, HTTP/2 finished the page in about 809 ms and HTTP/1.1 in about 917 ms, and four of the five HTTP/2 runs landed within about a millisecond of each other:

h2load page-load runs at 100 ms RTT comparing HTTP/2 on one connection with HTTP/1.1 on six connections

The three latency points side by side:

Round tripHTTP/2, 1 connectionHTTP/1.1, 6 connectionsHTTP/1.1 slower by
LAN (0.4 ms)12.29 ms17.09 ms39%
40 ms328.08 ms376.60 ms15%
100 ms808.89 ms917.06 ms13%
HTTP/1.1 over six connections took 17.09 ms, 376.60 ms and 917.06 ms against 12.29 ms, 328.08 ms and 808.89 ms for HTTP/2 on one connection, so turning HTTP/2 off adds roughly 13 to 15 percent once real latency is in the path.HTTP/1.1 over six connections took 17.09 ms, 376.60 ms and 917.06 ms against 12.29 ms, 328.08 ms and 808.89 ms for HTTP/2 on one connection, so turning HTTP/2 off adds roughly 13 to 15 percent once real latency is in the path.
Time to fetch a 41-object page from Apache, HTTP/2 vs HTTP/1.1

The 39% on the LAN looks large, but it’s under 5 ms. The figures that matter to real visitors are the 13 to 15 percent at realistic latency, roughly 50 to 110 ms on a page this size. Raw throughput told a different story: hammering one 8 KB file with 50 clients on the LAN, HTTP/1.1 sustained about 7,500 to 7,800 requests per second against 6,400 to 6,800 for HTTP/2 multiplexing ten streams per connection. One run of each protocol reported failed requests, so read those as ranges, not exact rates. For a mitigation measured in days, that trade is easy to accept.

A reverse proxy in front does not hide the origin

Plenty of Apache servers sit behind nginx, a load balancer or Cloudflare, and the usual assumption is that the edge speaks HTTP/2 so the origin doesn’t. That holds only for traffic that goes through the edge. We put nginx on edge-01 terminating HTTP/2 and proxying to Apache with mod_http2 still loaded. The proxy part of the config was plain, and our nginx reverse proxy guide covers the rest. The lab ran the Ubuntu 24.04 nginx package, so the listen ... http2 form below is what it accepts; nginx 1.25.1 and later deprecate it in favour of a separate http2 on; line:

server {
    listen 443 ssl http2;
    server_name app.example.com;

    ssl_certificate     /etc/ssl/certs/ssl-cert-snakeoil.pem;
    ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;

    location / {
        proxy_pass https://10.0.1.50;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_ssl_server_name on;
        proxy_ssl_name app.example.com;
    }
}

A client got HTTP/2 from nginx, and Apache logged that request as HTTP/1.1 from the proxy at 10.0.1.10. A second machine that went straight to the origin address was logged as HTTP/2.0 a second later. The ufw rules below the log are the fix:

Apache access log showing HTTP/1.1 from the nginx proxy and HTTP/2.0 from a direct client, with ufw limiting 443 to the proxy

Origin addresses leak through old DNS records, certificate transparency logs and mail headers, and scanners sweep entire provider ranges for port 443 anyway. Until the module is off, allow web ports on the origin from the proxy only. Allow SSH first, because ufw drops every inbound connection it has no rule for, and that includes the session you are typing in; if sshd listens on a port other than 22, allow that port instead of the OpenSSH profile:

sudo ufw allow OpenSSH
sudo ufw allow from 10.0.1.10 to any port 80,443 proto tcp
sudo ufw --force enable

Adding a proxy rule does not remove an older one, so a rule that opens 80 or 443 to everyone keeps the origin public whatever else the list holds. Hosts set up with the Apache Full profile have exactly that rule. List the rules with their numbers and read every line:

sudo ufw status numbered

On the lab origin only the proxy could reach the web ports:

Status: active

     To                         Action      From
     --                         ------      ----
[ 1] OpenSSH                    ALLOW IN    Anywhere
[ 2] 80,443/tcp                 ALLOW IN    10.0.1.10
[ 3] OpenSSH (v6)               ALLOW IN    Anywhere (v6)

If your list shows Apache, Apache Full, Apache Secure, 80 or 443 allowed from Anywhere, remove it together with its (v6) twin, because deleting by number removes only one line; sudo ufw delete allow 'Apache Full' takes out both. Then list again. With the list clean, the direct request from the second machine timed out with curl exit code 28, and the request through nginx still returned HTTP/2 200. Rocky and other EL hosts use firewalld instead, where the same idea is a rich rule that accepts the web ports only from the proxy source address after the http and https services are removed from the zone.

Behind Cloudflare, the same logic applies with two extra facts from the Cloudflare HTTP/2 to Origin documentation. The feature is on by default on every plan, and Cloudflare negotiates it through ALPN, falling back to HTTP/1.1 when the origin does not offer HTTP/2. Once the module is off, Cloudflare drops to HTTP/1.1 on its own. To lock the origin, allow 443 only from the ranges at https://www.cloudflare.com/ips-v4 (15 IPv4 blocks when we fetched it) and the matching IPv6 list.

Switching HTTP/2 back on after the patch

Leave the mitigation in place until a fixed package is actually installed, not merely announced. On 12 November the lab repositories still offered the vulnerable builds. apt-cache policy apache2 showed the installed and candidate versions as identical on both Ubuntu releases, and dnf check-update mod_http2 httpd on Rocky exited 0 with nothing to install. Run the same checks before you undo anything:

sudo apt-get -qq update && apt-cache policy apache2 | head -3
sudo dnf -q check-update mod_http2 httpd; echo "exit=$?"; rpm -q mod_http2

When the update lands, install it first and confirm the version against the advisory from your distro, using the fixed builds listed in our Apache CVE-2026-119618 patch guide. On a control panel such as DirectAdmin, Apache is built by CustomBuild rather than installed from apt or dnf, so take the fix from the DirectAdmin CustomBuild Apache patch instead. Then reverse the change, restart, and run the probe until it shows 2 again:

sudo a2enmod http2 && sudo systemctl restart apache2
sudo sed -i "s/^#LoadModule http2_module/LoadModule http2_module/" /etc/httpd/conf.modules.d/10-h2.conf && sudo systemctl restart httpd

The first line is for Ubuntu and Debian, and it brings http2.conf back with its h2 h2c list. If you also disabled proxy_http2, enable it in the same call with a2enmod http2 proxy_http2. If you rewrote Protocols lines instead, put the old lists back. The second line is for EL hosts, and ours went back to HTTP/2 on all three probe paths. Keep the origin firewall rules unless they were meant to be temporary, because a locked origin also protects you from the next module bug. The same order applied to the nginx alias heap overflow: patch, verify, then relax the workaround.

The same Apache release also fixes an important mod_md crash and a low-severity mod_vhost_alias bug, so take the update even on hosts that never ran HTTP/2. While you’re on these hosts, work through recent advisories such as APT CVE-2026-109518 and the kernel TCP flaw CVE-2026-98432. If you’re building a fresh Ubuntu web host while this is open, the Apache install guide for Ubuntu 26.04 leaves mod_http2 disabled, so hold off on a2enmod http2 until the fixed package is in.

Audit checklist for an HTTP/1.1-only origin

Run through this on every Apache host before you call the mitigation done. Each item is something you can check from a shell or from the probe:

  1. apache2ctl -M or httpd -M lists no http2_module, or every active Protocols line reads http/1.1 only.
  2. The probe from another machine shows 1.1 for the origin IP and for every vhost that has its own Protocols line.
  3. The h2c upgrade row reads 1.1 and the prior knowledge row reads 0.
  4. On EL hosts, 10-h2.conf still exists and its LoadModule line is commented, not renamed away.
  5. ufw status numbered shows 80 and 443 allowed only from the proxy or CDN ranges, with no rule allowing them from Anywhere or Anywhere (v6).
  6. No ProxyPass uses an h2:// backend you forgot about after disabling proxy_http2.
  7. Someone owns the follow-up: installing the fixed package, then re-enabling HTTP/2 and re-running the probe.

Item six is the one that bites. A mitigation that breaks a backend gets reverted under pressure, often by someone who never saw this CVE, so test every proxied path before you walk away.

Keep reading

UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 PHP2Shell (CVE-2026-109618, CVE-2026-109619): Check and Patch PHP Php PHP2Shell (CVE-2026-109618, CVE-2026-109619): Check and Patch PHP PHP2Shell on End-of-Life PHP 8.1, 8.0 and 7.4 (WHMCS, ionCube) Php PHP2Shell on End-of-Life PHP 8.1, 8.0 and 7.4 (WHMCS, ionCube) Git CVE-2026-111760: Check and Patch the Recursive Clone RCE Git Git CVE-2026-111760: Check and Patch the Recursive Clone RCE NoisyTCP (CVE-2026-99288): Check, Mitigate, Patch the Kernel Security NoisyTCP (CVE-2026-99288): Check, Mitigate, Patch the Kernel Restic Backup to S3-Compatible Storage on Linux Rocky Linux Restic Backup to S3-Compatible Storage on Linux

Leave a Comment

Press ESC to close