A Critical Linux Bug Dropped. Here’s How I Checked My Server.
A use-after-free in the Linux kernel's IPv4 TCP connection-setup code allows a remote attacker to achieve root code execution, demonstrated when MPTCP is active. The author checked their own server and found it vulnerable but not exposed to the proven attack path.
medium.com
Published on medium.com
Cybersecurity
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a write-up about checking a single self-hosted Linux server against a kernel vulnerability, not about a bug bounty submission. The subject is CVE-2026-98432, a use-after-free in the Linux kernel's IPv4 TCP connection-setup code, specifically the path through ip_options_build(). The Linux kernel CVE team rated it 9.8 out of 10.
The feature involved is ordinary TCP connection setup, and the demonstrated attack path runs through MPTCP (Multipath TCP), which lets one connection use several network paths at once, such as Wi-Fi and cellular. The author's target is a small Linux server on the public internet running a few side projects, with SSH open and a reverse proxy written in Go sitting in front of them. The server runs Ubuntu 26.04 LTS.
The author's framing of the bug:
- What it is: a use-after-free in the kernel's IPv4 TCP connection-setup code. Memory gets freed and then used again; with careful timing an attacker can put their own data in that freed memory.
- Who can trigger it: any remote client. No credentials are needed, only the ability to open a TCP connection to the machine.
- What was demonstrated: researchers got remote root code execution against a server listening with MPTCP. Their exploit first leaked a kernel address to get around KASLR, then overwrote a callback pointer. It reportedly took about 53 minutes from start to root.
- How far back it goes: some write-ups say kernels back to 4.4 are affected, but the author advises checking the distribution's advisory rather than relying on that number.
Two points the author stresses. First, most server owners never knowingly turned MPTCP on, but recent Go releases ask for MPTCP on listening sockets by default, so a web server, reverse proxy or API written in Go (Caddy, Traefik, many custom services) may be accepting MPTCP connections without the operator knowing. Second, the bug is in TCP itself, not only in MPTCP. MPTCP is the path that was proven exploitable, but the faulty code can still be reached with ordinary TCP traffic. No public exploit has shown remote code execution that way yet, but turning off MPTCP shrinks exposure without fixing the bug. Only a patched kernel that is actually running fixes it.

Setup
No accounts, roles or special tooling are needed beyond a shell on the server. The preconditions are:
- A Linux server reachable from the internet, with at least one TCP port exposed.
- A distribution whose CVE tracker can be consulted (the author uses Ubuntu's page for CVE-2026-98432).
ufwas the firewall front end,ssfrom iproute2,sysctl, and optionally Docker with Compose.- Root or sudo access, since several checks and all the changes require it.
The author estimates the whole check takes about fifteen minutes on your own server.
Finding it
The trigger was a post circulating on social media:
"Hard to overstate how big of a deal this is. Any unpatched Linux server with even a single TCP port exposed to the internet and MPTCP active (default for many Go web servers) is vulnerable to complete takeover."
The rest of the article is the process of answering that question with four checks, then closing the doors that were open.
Exploitation
The article does not exploit the bug. It walks through the checks the author ran on his own machine and the hardening he applied. Each step below is reproduced with the commands exactly as published.
Step 1: Which kernel is actually running?
uname -rapt list - installed 2>/dev/null | grep -E '^linux-image'
uname -r shows the kernel running in memory. The apt list pipeline lists installed linux-image packages. The point is that the kernel installed on disk and the kernel running in memory are different things: seeing a new linux-image package does not protect you until you reboot into it.
The author's result:
7.0.0–38-genericlinux-image-generic … 7.0.0–38.38 [installed,upgradable to: 7.0.0–42.42]
He then checked the Ubuntu page for CVE-2026-98432, which said:
Vulnerable — work in progress in 7.0.0–43.43
So the running kernel was vulnerable, and the pending -42 upgrade would not have fixed it either, because the fix was still being prepared for -43. The lesson: checking that an upgrade exists isn't enough; check that the upgrade contains the fix.
The upstream stable kernels with the fix were 5.10.272, 5.15.223, 6.1.190, 6.6.159, 6.12.113, 6.18.56, 7.2.10, 7.3 and later. Distribution kernels backport fixes under their own version numbers, so the distribution's advisory is the source of truth, not upstream version numbers.
Step 2: Is MPTCP turned on?
sysctl net.mptcp.enabled
net.mptcp.enabled = 1
It was on. That only means the kernel allows MPTCP; something still has to be listening with it.
Step 3: Is anything listening with MPTCP?
sudo ss -M -ltnp sudo ss -ltnp
To read the output, look at the Netid column: MPTCP sockets show up as mptcp. The author's all showed tcp:
Netid State Local Address:Port Processtcp LISTEN [redacted]%lo:53 systemd-resolvetcp LISTEN [redacted]:22 sshdtcp LISTEN [::]:22 sshd
There were no MPTCP listeners. The only service reachable from the internet was SSH on port 22, and OpenSSH is written in C and does not use MPTCP.
The surprise was that the Go reverse proxy was not listening on 80 or 443 at all: the stack happened to be down. When it started again, it would most likely open MPTCP listeners and expose exactly the setup the exploit was built for. At that moment the server was safe from the published exploit only by luck.
Step 4: Is the other trigger path turned on?
The Ubuntu advisory also lists request-socket migration as a way to reach the bug:
sysctl net.ipv4.tcp_migrate_req
net.ipv4.tcp_migrate_req = 0
It was off, which is the default. If yours is 1, find out what turned it on.
Where that left the server
In short: vulnerable, but the proven attack had no way in yet. The plan was to keep that door closed before the stack came back, make the remaining door smaller, and patch the moment a fix shipped.
Step 1 of the lockdown: turn off MPTCP system-wide
echo 'net.mptcp.enabled=0' | sudo tee /etc/sysctl.d/99-no-mptcp.confsudo sysctl - systemsysctl net.mptcp.enabled
This closes the demonstrated exploit path whatever starts listening later. The file in /etc/sysctl.d/ keeps the setting after a reboot. Unless you knowingly use multipath networking, you will not notice any difference.
Step 2: tell Go services not to ask for MPTCP
This is a second layer that keeps working if someone turns the sysctl back on. Go supports a per-process switch:
GODEBUG=multipathtcp=0
In Docker Compose, add it to the Go service:
services:caddy:environment:- GODEBUG=multipathtcp=0
For a systemd service, add Environment=GODEBUG=multipathtcp=0 to the unit. The author is explicit that this is a stopgap: it removes one attack path and leaves the underlying bug in place.
Step 3: make the remaining TCP exposure smaller
The bug can be reached with plain TCP, so every port open to the whole internet is a way in. Ports 80 and 443 must stay public for a website; SSH does not need to be. The plan is to allow SSH only from the author's own IP address, which raises the question of what that IP actually is.
Step 3a: get your IP from the server's point of view
Googling "what's my IP" is the wrong number to trust: VPNs, proxies, corporate networks and carrier-grade NAT can all make a website see a different address from the one your SSH connection comes from. If you allow the wrong address and then delete the open rule, you are locked out. The author almost did exactly that; the address he had in mind was not the one his server was seeing.
The reliable way is to ask the server who it is talking to. From inside the current SSH session:
echo $SSH_CLIENT
The output has three fields:
[redacted] 28381 22
| Field | Meaning |
|---|---|
[redacted] |
Your IP as the server sees it. This is the one to use. |
28381 |
The port on your side of the connection (random, ignore it). |
22 |
The server's SSH port. |
If you are on sudo or su and the variable is empty, these show the same information:
who am i ss -tnp | grep sshd
Step 3b: add the new rule before removing the old one
Order matters. Add the narrow rule first, test it, and remove the open rule last:
sudo ufw allow from [redacted] to any port 22 proto tcpssh user@your-serversudo ufw delete allow 22/tcpsudo ufw status numbered
Adding the specific rule does nothing on its own. While the generic 22/tcp ALLOW Anywhere rule exists, everyone still gets in; this step is where the lockdown actually takes effect. A correct result looks like:
[ 1] 80/tcp ALLOW IN Anywhere[ 2] 443/tcp ALLOW IN Anywhere[ 3] 22/tcp ALLOW IN [redacted][ 4] 80/tcp (v6) ALLOW IN Anywhere (v6)[ 5] 443/tcp (v6) ALLOW IN Anywhere (v6)
Port 22 appears once, from your address only, and there is no 22/tcp (v6) Anywhere line left behind. The current session keeps working through all of this, because ufw does not cut off connections that are already established. That is exactly why you test with a new session.
Step 3c: watch out for a changing IP
A few hours later the address on the rule no longer matched: the author's home IP had changed. Looking back at the Last login: … from … line, it had been changing all along within the same ISP block. If your IP is dynamic, a single-IP rule will eventually lock you out. The options given:
- Allow your ISP's range, for example
sudo ufw allow from [redacted]/24 to any port 22 proto tcp. Quick and much smaller than "Anywhere", but not as tight. - Use a VPN such as Tailscale or WireGuard. Allow port 22 only on the VPN interface and stop exposing it publicly at all. This is the proper fix.
- Whatever you choose, bookmark your provider's web console. It is your way back in if a firewall change goes wrong.
Always keep a working session open while you change firewall or SSH settings; locking yourself out of a remote server is the one mistake here that is hard to undo.
Step 3d: Docker skips ufw
Ports published by Docker (ports: in Compose) go around ufw entirely, because Docker writes its own iptables rules. A line like 6379:6379 for Redis makes it reachable from the internet no matter what ufw status says. Check with docker ps: in the PORTS column, 6379/tcp means internal only, which is fine, while [redacted]:6379->6379/tcp means published to the world. Leave internal services unpublished, or bind them to localhost ([redacted]:6379:6379).
Step 4: fix the things you have been putting off
The check turned up other problems: the author was logging in as root (the lockdown step from his original setup had never been done), 74 pending updates had piled up, and the login banner was already recommending fail2ban. The fix:
sudo apt update && sudo apt full-upgradesudo apt install -y fail2bansudo systemctl restart ssh
Step 5: patch, reboot, and check
This is the only step that actually fixes the bug.
- Watch your distribution's tracker (Ubuntu, Debian, or Red Hat Product Security) until your release shows a released fix. Debian 12 and 13 had fixed packages by October 30; Ubuntu's were still in progress when the author wrote the article.
- Upgrade and reboot:
sudo apt update && sudo apt full-upgradesudo reboot
- Check that the server came back healthy on the new kernel:
uname -r systemctl - failed journalctl -k -b -p warning
Once uname -r shows the fixed version, you are patched, and you can turn MPTCP back on if you actually need it. The author is leaving it off, since he never used it.
What the reboot looked like
The author did not wait for the CVE fix to reboot. The 74 pending updates included a newer kernel (not the fixed one yet) and several services that needrestart had held back. At the end of the upgrade, apt said plainly:
Pending kernel upgrade!Running kernel version:7.0.0–38-genericDiagnostics:The currently running kernel version is not the expected kernel version 7.0.0–42-generic.
That is the "installed isn't running" lesson in apt's own words. Before rebooting, he checked that the mitigations would survive it:
cat /etc/sysctl.d/99-no-mptcp.conf
ufw rules persist on their own. After the reboot he ran the checks again:
uname -r sysctl net.mptcp.enabled ufw status numbered systemctl - failed docker ps
Everything came back by itself because every container had restart: unless-stopped. If yours do not, a reboot leaves them down until you start them again. The server was mitigated and cleaner, but not yet patched: the kernel fix for that release was still on the way, so the last step is waiting for it, installing it, and rebooting once more.
The checklist
uname -r sysctl net.mptcp.enabled sudo ss -M -ltnp sysctl net.ipv4.tcp_migrate_req echo 'net.mptcp.enabled=0' | sudo tee /etc/sysctl.d/99-no-mptcp.conf && sudo sysctl - systemecho $SSH_CLIENT sudo ufw allow from <that-ip> to any port 22 proto tcpsudo ufw delete allow 22/tcpsudo apt update && sudo apt full-upgrade && sudo rebootuname -r
Root cause
The flaw is a use-after-free in the kernel's IPv4 TCP connection-setup code, on the path through ip_options_build(). Memory is freed and then used again, and with careful timing an attacker can place their own data in the freed region. The demonstrated exploit against an MPTCP listener first leaked a kernel address to defeat KASLR, then overwrote a callback pointer, reaching remote root in about 53 minutes.
Why the existing defences did not stop it: the bug sits in TCP itself, so MPTCP is only the proven route to it, and ordinary TCP traffic can still reach the faulty code. No public exploit has shown remote code execution over plain TCP yet. Disabling MPTCP therefore reduces exposure without removing the bug; only a patched kernel that is actually running fixes it. The author's own server illustrates the second failure mode: the Go reverse proxy would have opened MPTCP listeners by default had it been running, so the exposure existed without any deliberate configuration choice.
Impact
Under the conditions described, an attacker who can open a TCP connection to a vulnerable machine, with MPTCP active and a listener using it, can obtain remote root code execution with no credentials. The author's server was vulnerable at the kernel level, but the proven attack had no way in at the time of the check: no MPTCP listeners existed, the only internet-reachable service was SSH on port 22 (OpenSSH, written in C, does not use MPTCP), and net.ipv4.tcp_migrate_req was 0. That safety was accidental, since the Go stack was simply down and would most likely have opened MPTCP listeners when restarted.
At the time of writing there were no confirmed reports of exploitation in the wild, but the technique was public and the author expected attackers to scan for unpatched machines soon.
Fix
What the author changed, in order:
- Disabled MPTCP system-wide with
net.mptcp.enabled=0in/etc/sysctl.d/99-no-mptcp.conf, persisted across reboots. - Set
GODEBUG=multipathtcp=0for Go services, via Composeenvironment:or a systemdEnvironment=line, as a second layer. - Restricted SSH to his own address with ufw, adding the narrow rule before deleting
22/tcp; when his IP changed, the report lists an ISP range or a VPN-only SSH port as options. - Audited Docker-published ports, since they bypass ufw.
- Ran the fix commands: full upgrade, install fail2ban, restart ssh; root login had still been in use.
- Planned to wait for the distribution's released kernel fix, upgrade, reboot, and confirm with
uname -r.
What should be done, as opposed to what was done: the kernel patch is the only real fix, and it must be running, not merely installed. The MPTCP and Go switches are explicitly described as stopgaps that remove one attack path and leave the bug in place.
Variants to test
- Go services on other hosts. Run
sudo ss -M -ltnpon any server running a Go-based proxy or API. A positive result is a listener with Netidmptcp; that host matches the setup the demonstrated exploit was built for. - Request-socket migration. Check
sysctl net.ipv4.tcp_migrate_reqon each host. A value of1means the second trigger path listed in the advisory is enabled, and you should find out what set it. - Docker-published ports. Compare
docker psPORTS entries againstufw status. A positive result is a[redacted]:<port>-><port>/tcpmapping for a service you believed the firewall was protecting. - Installed versus running kernel. Compare
uname -rwith the installedlinux-imagepackage and the distribution's advisory. A positive result is a running version below the fixed one for your release, or an installed package whose version the advisory does not list as fixed. - Dynamic client addresses. Compare the address in
echo $SSH_CLIENTwith the address in theLast login: … from …line over several days. A positive result is a changing address within one ISP block, which means a single-IP firewall rule will eventually lock you out. - Reboot resilience. After a reboot, run
systemctl --failed,docker psandufw status numbered. A positive result is a container that did not come back because it lacksrestart: unless-stopped, or a sysctl that did not persist because it was set at runtime only.
What happened, in plain words
A very serious security flaw was found in Linux, the operating system that runs most of the internet's servers. The flaw got an official identifier, CVE-2026-98432, and the team that tracks Linux security issues gave it 9.8 out of 10 for severity. In plain terms: a stranger on the internet could trigger the flaw without any username or password, just by connecting to it; remote root was demonstrated against servers listening with MPTCP.
This article is not about a bug bounty payout. It is one server owner's account of checking his own small Linux machine, finding out whether he was exposed, and closing the doors he could close while he waited for the official fix. He runs a few side projects on it, has SSH open (the remote login service), and has a reverse proxy written in Go sitting in front of those projects. The machine runs Ubuntu 26.04 LTS.
You do not need to be a security professional to follow along. You need a browser, a computer, and the willingness to type a few commands into a terminal on your own server. The author estimates the whole check takes about fifteen minutes.

The concepts you need first
Before the checks make sense, here are the ideas behind them, explained from zero.
- A server is just a computer that stays switched on and answers requests from other computers. When you open a website, your browser asks a server for a page and the server sends it back.
- A port is like a numbered door on that computer. A server can have many doors open at once, each for a different service. Web pages usually arrive through doors 80 and 443. Remote login usually uses door 22.
- TCP is the set of rules computers use to open a connection and make sure the data arrives in order. Think of it as the postal service: it sets up the conversation, delivers the letters, and confirms they arrived.
- The kernel is the core of the operating system, the part that talks directly to the hardware and manages memory. If the kernel has a flaw, everything above it is affected.
- A use-after-free is a specific kind of programming mistake. The program frees a piece of memory (hands it back, saying "I am done with this"), and then keeps using it as if it still owned it. If an attacker can time things carefully, they can put their own data into that freed space before the program reads it again. The everyday comparison: you cancel your hotel room, the hotel gives the key to someone else, and you still walk in and use the room.
- Remote code execution means an attacker can make the server run commands of their choosing, from a distance. Root is the all-powerful administrator account on Linux. Remote root means the attacker effectively owns the machine.
- KASLR is a defence that randomises where things sit in the kernel's memory, so an attacker cannot simply guess an address. An exploit that "leaks a kernel address" is finding out where something lives, so it can aim at it.
- MPTCP (Multipath TCP) is an extension of TCP that lets one connection travel over several network paths at once, for example Wi-Fi and mobile data together. It is useful, but most server owners never deliberately switched it on.
- Go is a programming language often used for web servers, reverse proxies and APIs. A reverse proxy is a server that sits in front of your applications and forwards visitors' requests to them. Caddy and Traefik are popular Go-based reverse proxies.
- An API is a way for one program to talk to another over the network, usually returning data rather than a web page.
- SSH is the standard way to log in to a Linux server remotely and get a command line. OpenSSH is the most common implementation of it.
- A firewall decides which doors (ports) are open to whom. ufw is a simple front end for the firewall on Ubuntu.
- sysctl is the command for reading and changing kernel settings while the system runs. A sysctl file in
/etc/sysctl.d/makes such a setting survive a reboot. - Docker runs applications in isolated boxes called containers. Docker Compose is a way to describe those containers in a configuration file.
- A CVE tracker is a public web page where a Linux distribution lists each known vulnerability and whether its own packages are fixed yet.
How the author found out
The trigger was a post going around social media:
"Hard to overstate how big of a deal this is. Any unpatched Linux server with even a single TCP port exposed to the internet and MPTCP active (default for many Go web servers) is vulnerable to complete takeover."
His first thought was "that's me". His second was "I don't actually know whether that's me". The rest of the article is the process of answering that question with four checks, then closing the doors that were open.
What the bug actually is
The author's own summary of the flaw:
- What it is: a use-after-free in the kernel's IPv4 TCP connection-setup code, specifically the path through
ip_options_build(). Memory gets freed and then used again; with careful timing an attacker can put their own data in that freed memory. - Who can trigger it: any remote client. No credentials are needed, only the ability to open a TCP connection to the machine.
- What was demonstrated: researchers got remote root code execution against a server listening with MPTCP. Their exploit first leaked a kernel address to get around KASLR, then overwrote a callback pointer. It reportedly took about 53 minutes from start to root.
- How far back it goes: some write-ups say kernels back to 4.4 are affected, but check your distribution's advisory rather than relying on that number.
Two points he stresses. First, most server owners never knowingly turned MPTCP on, but recent Go releases ask for MPTCP on listening sockets by default, so a web server, reverse proxy or API written in Go may be accepting MPTCP connections without the operator knowing. Second, the bug is in TCP itself, not only in MPTCP. MPTCP is the path that was proven exploitable, but the faulty code can still be reached with ordinary TCP traffic. No public exploit has shown remote code execution that way yet, but turning off MPTCP shrinks exposure without fixing the bug. Only a patched kernel that is actually running fixes it.
The four checks
Check 1: Which kernel is actually running?
uname -rapt list - installed 2>/dev/null | grep -E '^linux-image'
Line by line:
uname -rprints the version of the kernel that is running in memory right now.apt list - installedasks the package manager to list installed packages.2>/dev/nullthrows away error messages so they do not clutter the output.| grep -E '^linux-image'filters that list down to lines starting withlinux-image, which are the kernel packages.
The point is that the kernel installed on disk and the kernel running in memory are different things. Seeing a new linux-image package does not protect you until you reboot into it. The comparison: you bought a new lock for your front door, but the old lock is still the one on the door until you fit it.
His result:
7.0.0–38-genericlinux-image-generic … 7.0.0–38.38 [installed,upgradable to: 7.0.0–42.42]
He then checked the Ubuntu page for CVE-2026-98432, which said:
Vulnerable — work in progress in 7.0.0–43.43
So the running kernel was vulnerable, and the pending -42 upgrade would not have fixed it either, because the fix was still being prepared for -43. The lesson: checking that an upgrade exists isn't enough; check that the upgrade contains the fix.
The upstream stable kernels with the fix were 5.10.272, 5.15.223, 6.1.190, 6.6.159, 6.12.113, 6.18.56, 7.2.10, 7.3 and later. Distribution kernels backport fixes under their own version numbers, so the distribution's advisory is the source of truth, not upstream version numbers.
Check 2: Is MPTCP turned on?
sysctl net.mptcp.enabled
net.mptcp.enabled = 1
sysctl reads a kernel setting by name. net.mptcp.enabled is the switch for MPTCP, and 1 means on. That only means the kernel allows MPTCP; something still has to be listening with it. The comparison: the road is open, but no car has driven down it yet.
Check 3: Is anything listening with MPTCP?
sudo ss -M -ltnp sudo ss -ltnp
Line by line:
sudoruns the command with administrator rights, which is needed to see which program owns each connection.sslists network connections on the machine.-lshows only sockets that are listening, waiting for connections.-tlimits it to TCP.-nshows numbers instead of names.-pshows the program that owns each socket.
The second sudo ss -ltnp is the plain TCP listing, without the MPTCP filter, so you can compare the two.
To read the output, look at the Netid column: MPTCP sockets show up as mptcp. His all showed tcp:
Netid State Local Address:Port Processtcp LISTEN [redacted]%lo:53 systemd-resolvetcp LISTEN [redacted]:22 sshdtcp LISTEN [::]:22 sshd
There were no MPTCP listeners. The only service reachable from the internet was SSH on port 22, and OpenSSH is written in C and does not use MPTCP.
The surprise was that the Go reverse proxy was not listening on 80 or 443 at all: the stack happened to be down. When it started again, it would most likely open MPTCP listeners and expose exactly the setup the exploit was built for. At that moment the server was safe from the published exploit only by luck.
Check 4: Is the other trigger path turned on?
The Ubuntu advisory also lists request-socket migration as a way to reach the bug:
sysctl net.ipv4.tcp_migrate_req
net.ipv4.tcp_migrate_req = 0
It was off, which is the default. If yours is 1, find out what turned it on.
Where that left the server
In short: vulnerable, but the proven attack had no way in yet. The plan was to keep that door closed before the stack came back, make the remaining door smaller, and patch the moment a fix shipped.
Locking it down, step by step
Step 1: Turn off MPTCP system-wide
echo 'net.mptcp.enabled=0' | sudo tee /etc/sysctl.d/99-no-mptcp.confsudo sysctl - systemsysctl net.mptcp.enabled
Line by line:
echo 'net.mptcp.enabled=0'produces the text of the setting you want.| sudo tee /etc/sysctl.d/99-no-mptcp.confwrites that text into a configuration file, with administrator rights.teeis used instead of a plain redirect because it can write to protected locations.sudo sysctl - systemreloads all the settings files so the new one takes effect immediately.sysctl net.mptcp.enabledreads the setting back to confirm it is now0.
This closes the demonstrated exploit path whatever starts listening later. The file in /etc/sysctl.d/ keeps the setting after a reboot. Unless you knowingly use multipath networking, you will not notice any difference.
Step 2: Tell Go services not to ask for MPTCP
This is a second layer that keeps working if someone turns the sysctl back on. Go supports a per-process switch:
GODEBUG=multipathtcp=0
GODEBUG is an environment variable, a named value that a program reads when it starts. Setting multipathtcp=0 tells the Go program not to request MPTCP on its listening sockets.
In Docker Compose, add it to the Go service:
services:caddy:environment:- GODEBUG=multipathtcp=0
This says: for the service called caddy, set the environment variable GODEBUG to multipathtcp=0 when the container starts.
For a systemd service, add Environment=GODEBUG=multipathtcp=0 to the unit. systemd is the part of Linux that starts and manages background services; a unit file is its description of one service.
The author is explicit that this is a stopgap: it removes one attack path and leaves the underlying bug in place.
Step 3: Make the remaining TCP exposure smaller
The bug can be reached with plain TCP, so every port open to the whole internet is a way in. Ports 80 and 443 must stay public for a website; SSH does not need to be. The plan is to allow SSH only from the author's own IP address, which raises the question of what that IP actually is.
Step 3a: Get your IP from the server's point of view
Googling "what's my IP" is the wrong number to trust: VPNs, proxies, corporate networks and carrier-grade NAT can all make a website see a different address from the one your SSH connection comes from. If you allow the wrong address and then delete the open rule, you are locked out. The author almost did exactly that; the address he had in mind was not the one his server was seeing.
The reliable way is to ask the server who it is talking to. From inside the current SSH session:
echo $SSH_CLIENT
echo prints a value. $SSH_CLIENT is a variable that the SSH server fills in with details about your current connection. The output has three fields:
[redacted] 28381 22
| Field | Meaning |
|---|---|
[redacted] |
Your IP as the server sees it. This is the one to use. |
28381 |
The port on your side of the connection (random, ignore it). |
22 |
The server's SSH port. |
If you are on sudo or su and the variable is empty, these show the same information:
who am i ss -tnp | grep sshd
who am i shows your own login session. ss -tnp | grep sshd lists TCP connections with program names and keeps only the lines belonging to sshd, the SSH server, which includes the address it is talking to.
Step 3b: Add the new rule before removing the old one
Order matters. Add the narrow rule first, test it, and remove the open rule last:
sudo ufw allow from [redacted] to any port 22 proto tcpssh user@your-serversudo ufw delete allow 22/tcpsudo ufw status numbered
Line by line:
sudo ufw allow from [redacted] to any port 22 proto tcpadds a firewall rule that lets only that one address reach port 22 over TCP.ssh user@your-serveropens a new login session, to prove the new rule works before you rely on it.sudo ufw delete allow 22/tcpremoves the old rule that let anyone in.sudo ufw status numberedlists the remaining rules with numbers, so you can see the result.
Adding the specific rule does nothing on its own. While the generic 22/tcp ALLOW Anywhere rule exists, everyone still gets in; this step is where the lockdown actually takes effect. A correct result looks like:
[ 1] 80/tcp ALLOW IN Anywhere[ 2] 443/tcp ALLOW IN Anywhere[ 3] 22/tcp ALLOW IN [redacted][ 4] 80/tcp (v6) ALLOW IN Anywhere (v6)[ 5] 443/tcp (v6) ALLOW IN Anywhere (v6)
Port 22 appears once, from your address only, and there is no 22/tcp (v6) Anywhere line left behind. The current session keeps working through all of this, because ufw does not cut off connections that are already established. That is exactly why you test with a new session: the old one would keep working even if you had locked yourself out.
Step 3c: Watch out for a changing IP
A few hours later the address on the rule no longer matched: the author's home IP had changed. Looking back at the Last login: … from … line, it had been changing all along within the same ISP block. If your IP is dynamic, a single-IP rule will eventually lock you out. The options given:
- Allow your ISP's range, for example
sudo ufw allow from [redacted]/24 to any port 22 proto tcp. The/24means a whole block of nearby addresses rather than one. Quick and much smaller than "Anywhere", but not as tight. - Use a VPN such as Tailscale or WireGuard. Allow port 22 only on the VPN interface and stop exposing it publicly at all. This is the proper fix.
- Whatever you choose, bookmark your provider's web console. It is your way back in if a firewall change goes wrong.
Always keep a working session open while you change firewall or SSH settings; locking yourself out of a remote server is the one mistake here that is hard to undo.
Step 3d: Docker skips ufw
Ports published by Docker (ports: in Compose) go around ufw entirely, because Docker writes its own iptables rules. iptables is the lower-level firewall that ufw is a friendly front end for, and Docker adds its own entries directly. A line like 6379:6379 for Redis makes it reachable from the internet no matter what ufw status says. Redis is a data store that should normally stay private.
Check with docker ps, which lists running containers. In the PORTS column, 6379/tcp means internal only, which is fine, while [redacted]:6379->6379/tcp means published to the world. Leave internal services unpublished, or bind them to localhost ([redacted]:6379:6379), which means only the machine itself can reach them.
Step 4: Fix the things you have been putting off
The check turned up other problems: the author was logging in as root (the lockdown step from his original setup had never been done), 74 pending updates had piled up, and the login banner was already recommending fail2ban. fail2ban is a tool that watches login attempts and temporarily blocks addresses that keep failing.
The fix:
sudo apt update && sudo apt full-upgradesudo apt install -y fail2bansudo systemctl restart ssh
Line by line:
sudo apt update && sudo apt full-upgraderefreshes the list of available packages and then installs all available upgrades.sudo apt install -y fail2baninstalls fail2ban, with-yanswering yes to the confirmation prompt.sudo systemctl restart sshrestarts the SSH service so it picks up any changes.
Step 5: Patch, reboot, and check
This is the only step that actually fixes the bug.
- Watch your distribution's tracker (Ubuntu, Debian, or Red Hat Product Security) until your release shows a released fix. Debian 12 and 13 had fixed packages by October 30; Ubuntu's were still in progress when the author wrote the article.
- Upgrade and reboot:
sudo apt update && sudo apt full-upgradesudo reboot
sudo reboot restarts the machine, which is what makes the newly installed kernel the running one; in the author's case that kernel was not yet the fixed one.
- Check that the server came back healthy on the new kernel:
uname -r systemctl - failed journalctl -k -b -p warning
Line by line:
uname -rshows the running kernel version, which should now be the fixed one.systemctl - failedlists services that failed to start.journalctl -k -b -p warningshows kernel messages from this boot at warning level or above, so you can spot problems.
Once uname -r shows the fixed version, you are patched, and you can turn MPTCP back on if you actually need it. The author is leaving it off, since he never used it.
What the reboot looked like
The author did not wait for the CVE fix to reboot. The 74 pending updates included a newer kernel (not the fixed one yet) and several services that needrestart had held back. needrestart is a helper that notices when a service is still running old code after an upgrade. At the end of the upgrade, apt said plainly:
Pending kernel upgrade!Running kernel version:7.0.0–38-genericDiagnostics:The currently running kernel version is not the expected kernel version 7.0.0–42-generic.
That is the "installed isn't running" lesson in apt's own words. Before rebooting, he checked that the mitigations would survive it:
cat /etc/sysctl.d/99-no-mptcp.conf
cat prints the contents of the file, so you can confirm the MPTCP setting is really written there. ufw rules persist on their own. After the reboot he ran the checks again:
uname -r sysctl net.mptcp.enabled ufw status numbered systemctl - failed docker ps
This repeats the kernel check, the MPTCP check, the firewall listing, the failed-service listing and the container listing, all in one go. Everything came back by itself because every container had restart: unless-stopped, a Compose setting that tells Docker to start the container again after a reboot. If yours do not, a reboot leaves them down until you start them again. The server was mitigated and cleaner, but not yet patched: the kernel fix for that release was still on the way, so the last step is waiting for it, installing it, and rebooting once more.
The checklist
uname -r sysctl net.mptcp.enabled sudo ss -M -ltnp sysctl net.ipv4.tcp_migrate_req echo 'net.mptcp.enabled=0' | sudo tee /etc/sysctl.d/99-no-mptcp.conf && sudo sysctl - systemecho $SSH_CLIENT sudo ufw allow from <that-ip> to any port 22 proto tcpsudo ufw delete allow 22/tcpsudo apt update && sudo apt full-upgrade && sudo rebootuname -r
This is the whole process in one block: check the running kernel, check MPTCP, list MPTCP listeners, check the second trigger path, disable MPTCP persistently, find your real address, narrow SSH to it, remove the open rule, upgrade, reboot, and confirm the new kernel is running.
Why the defences did not stop it
The flaw sits in TCP itself, so MPTCP is only the proven route to it, and ordinary TCP traffic can still reach the faulty code. No public exploit has shown remote code execution over plain TCP yet. Disabling MPTCP therefore reduces exposure without removing the bug; only a patched kernel that is actually running fixes it. The author's own server illustrates the second failure mode: the Go reverse proxy would have opened MPTCP listeners by default had it been running, so the exposure existed without any deliberate configuration choice.
What the impact would have been
Under the conditions described, an attacker who can open a TCP connection to a vulnerable machine, with MPTCP active and a listener using it, can obtain remote root code execution with no credentials. The author's server was vulnerable at the kernel level, but the proven attack had no way in at the time of the check: no MPTCP listeners existed, the only internet-reachable service was SSH on port 22 (OpenSSH, written in C, does not use MPTCP), and net.ipv4.tcp_migrate_req was 0. That safety was accidental, since the Go stack was simply down and would most likely have opened MPTCP listeners when restarted.
At the time of writing there were no confirmed reports of exploitation in the wild, but the technique was public and the author expected attackers to scan for unpatched machines soon.
What he changed, in order
- Disabled MPTCP system-wide with
net.mptcp.enabled=0in/etc/sysctl.d/99-no-mptcp.conf, persisted across reboots. - Set
GODEBUG=multipathtcp=0for Go services, via Composeenvironment:or a systemdEnvironment=line, as a second layer. - Restricted SSH to his own address with ufw, adding the narrow rule before deleting
22/tcp, and later moved to considering an ISP range or a VPN-only SSH port because his IP was dynamic. - Audited Docker-published ports, since they bypass ufw.
- Ran the fix commands: full upgrade, install fail2ban, restart ssh; root login had still been in use.
- Planned to wait for the distribution's released kernel fix, upgrade, reboot, and confirm with
uname -r.
The kernel patch is the only real fix, and it must be running, not merely installed. The MPTCP and Go switches are explicitly described as stopgaps that remove one attack path and leave the bug in place.
Things to check on other machines
- Go services on other hosts. Run
sudo ss -M -ltnpon any server running a Go-based proxy or API. A positive result is a listener with Netidmptcp; that host matches the setup the demonstrated exploit was built for. - Request-socket migration. Check
sysctl net.ipv4.tcp_migrate_reqon each host. A value of1means the second trigger path listed in the advisory is enabled, and you should find out what set it. - Docker-published ports. Compare
docker psPORTS entries againstufw status. A positive result is a[redacted]:<port>-><port>/tcpmapping for a service you believed the firewall was protecting. - Installed versus running kernel. Compare
uname -rwith the installedlinux-imagepackage and the distribution's advisory. A positive result is a running version below the fixed one for your release, or an installed package whose version the advisory does not list as fixed. - Dynamic client addresses. Compare the address in
echo $SSH_CLIENTwith the address in theLast login: … from …line over several days. A positive result is a changing address within one ISP block, which means a single-IP firewall rule will eventually lock you out. - Reboot resilience. After a reboot, run
systemctl - failed,docker psandufw status numbered. A positive result is a container that did not come back because it lacksrestart: unless-stopped, or a sysctl that did not persist because it was set at runtime only.
What the author took away
- "Installed" isn't "running." Until you reboot, the patched kernel on disk does nothing.
- "An update is available" isn't "a fix is available." Read the advisory for your exact release.
- Know what your dependencies do by default. He never chose MPTCP. His Go reverse proxy would have chosen it for him.
- Being safe by accident isn't a security plan. His server dodged the exploit only because one service happened to be down.
- Ask the server who you are. Your IP according to a website and your IP according to your server can differ.
echo $SSH_CLIENTgives the one that matters for the firewall. - Add before you remove, and test with a new session. Firewall changes should never leave you without a way in.
- A scare is a good time to clean up. Root login, unpatched packages, and a world-open SSH port had all been sitting there. This bug got him to fix them.
Glossary
- API: a way for one program to talk to another over the network, usually returning data rather than a web page.
- apt: the package manager on Ubuntu and Debian, used to install and upgrade software.
- Caddy: a web server and reverse proxy written in Go.
- carrier-grade NAT: a technique used by internet providers that makes many customers share one public address, so a website may see a different address from the one your connection really uses.
- container: an isolated box in which an application runs, managed by Docker.
- CVE: a public identifier for a known security vulnerability.
- CVE tracker: a distribution's web page listing each vulnerability and whether its packages are fixed yet.
- Docker: software that runs applications in containers.
- Docker Compose: a way to describe containers and their settings in a configuration file.
- dynamic IP: an address that changes over time, as many home connections do.
- environment variable: a named value a program reads when it starts.
- fail2ban: a tool that watches login attempts and temporarily blocks addresses that keep failing.
- firewall: software that decides which ports are open to whom.
- Go: a programming language often used for web servers, reverse proxies and APIs.
- GODEBUG: an environment variable that changes how a Go program behaves at runtime.
- iptables: the lower-level firewall on Linux that ufw is a friendly front end for.
- KASLR: a defence that randomises where things sit in kernel memory, so an attacker cannot simply guess an address.
- kernel: the core of the operating system, which talks directly to the hardware and manages memory.
- localhost: the machine itself, address
[redacted]. - MPTCP (Multipath TCP): an extension of TCP that lets one connection use several network paths at once.
- needrestart: a helper that notices when a service is still running old code after an upgrade.
- Netid: the column in
ssoutput that says which kind of socket a line describes, such astcpormptcp. - OpenSSH: the most common implementation of the SSH remote login service.
- port: a numbered door on a computer, each used by a different service.
- remote code execution: an attacker's ability to make a machine run commands of their choosing from a distance.
- reverse proxy: a server that sits in front of your applications and forwards visitors' requests to them.
- root: the all-powerful administrator account on Linux.
- service: a program that runs in the background and waits for requests, such as a web server or SSH.
- SSH: the standard way to log in to a Linux server remotely and get a command line.
- SSH_CLIENT: a variable the SSH server fills in with the address, port and server port of your current connection.
- stopgap: a temporary measure that reduces risk without fixing the underlying problem.
- sysctl: the command for reading and changing kernel settings while the system runs.
- systemd: the part of Linux that starts and manages background services.
- TCP: the set of rules computers use to open a connection and make sure data arrives in order.
- Traefik: a reverse proxy written in Go.
- ufw: a simple front end for the Linux firewall on Ubuntu.
- unit file: systemd's description of one service.
- use-after-free: a programming mistake where memory is freed and then used again, letting an attacker place their own data in the freed space.
- VPN: a private network connection that makes your traffic appear to come from the VPN's address.
- WireGuard: a popular VPN protocol and tool.
- Tailscale: a VPN service built on WireGuard.