Even though sshd must run as root (in the usual case), it doesn't need unfettere... (2024)

Hacker News new | past | comments | ask | show | jobs | submit login

kbolino 5 months ago | parent | context | favorite | on: XZ backdoor: "It's RCE, not auth bypass, and gated...


Even though sshd must run as root (in the usual case), it doesn't need unfettered access to kernel memory, most of the filesystem, most other processes, etc. However, you could only really sandbox sshd-as-root. In order for sshd to do its job, it does need to be able to masquerade as arbitrary non-root users. That's still pretty bad but generally not "undetectably alter the operating system or firmware" bad.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (2)

sweetjuly 5 months ago [–]


>Even though sshd must run as root (in the usual case), it doesn't need unfettered access to kernel memory, most of the filesystem, most other processes, etc

This is sort of overlooking the problem. While true, the processes spawned by sshd do need to be able to do all these things and so even if you did sandbox it, preserving functionality would all but guarantee an escape is trivial (...just spawn bash?).

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (3)

kbolino 5 months ago | parent [–]


SELinux context is passed down to child processes. If sshd is running as confined root (system_u:system_r:sshd_t or similar), then the bash spawned by RCE will be too. Even if sshd is allowed to masquerade as an unconfined non-root user, that user will (regardless of SELinux) be unable to read or write /dev/kmem, ignore standard file permissions, etc.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (4)

sweetjuly 5 months ago | root | parent | next [–]


That's my point though--users expect to be able to do those things over ssh. Sandboxing sshd is hard because its child processes are expected to be able to do anything that an admin sitting at the console could do, up to and including reading/writing kernel memory.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (5)

kbolino 5 months ago | root | parent | next [–]


I'm assuming SSH root login is disabled and sudo requires separate authentication to elevate, but yeah, if there's a way to elevate yourself to unconfined root trivially after logging in, this doesn't buy you anything.

Now, sandboxing sudo (in the general case) with SELinux probably isn't possible.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (6)

CanaryLayout 5 months ago | root | parent | next [–]


This does not matter either. The attack came in by loading into systemd via liblzma. It put on a hook and then sits around waiting for sshd to load in so it can learn the symbols then proceeds to swap in the jumps.

sshd is a sitting duck. Bifurcating sshd into a multimodule scheme won't work because some part of it still has to be loaded by systemd.

This is a web of trust issue. In the .NET world where refection attacks happen to commercial software that features dynload assemblies, the only solution they could come up with is to sign all the things, then box up anything that doesn't have a signing mechanism and then sign that, even signing plain old zip files.

Some day we will all have to have keys, and to keep the anon people from leaving they can get an anon key, but anons with keys will never get on the chain where the big distros would ever trust their commits until someone who forked over their passport and photos got a trustable key to sign off on the commits, so that the distro builders can then greenlight pulling it in.

Then I guess to keep the anons hopeful that they are still in the SDLC somewhere their commits can go into the completely untrusted-unstable-crazytown release that no instutution in their right mind would ever lay down in production.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (7)

withinboredom 5 months ago | root | parent | next [–]


Do you think state actors won’t just print out random passports?

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (8)

LtWorf 5 months ago | root | parent | prev | next [–]


Anons will just steal identities, and randos will get accused of hacking they didn't do.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (9)

semiquaver 5 months ago | root | parent | prev [–]


I’ll admit to not being an expert in SELinux, but it seems like an impossibly leaky proposition. Root can modify systemd startup files, so just do that in a malicious way and reboot the system. that context won’t be propagated. And if you somehow prohibit root from doing that by SELinux policy then you end up with a system that can’t actually be administered.

[edit: sibling sweetjuly said it better than I could. I doubt that this much more than a fig leaf on any real world system given what sshd is required to have to do.]

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (10)

treasy 5 months ago | root | parent [–]


Selinux domains are uncoupled from Linux users. If sshd does not have Selinux permissions to edit those files it will simply be denied. Even if sshd is run as root

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (11)

semiquaver 5 months ago | root | parent [–]


Which amounts to the un-administerable system I mentioned. If it’s not possible to modify systemd config files using ssh, what happens when you need to edit them?

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (12)

kimixa 5 months ago | root | parent | next [–]


Really what they're proposing here is a non-modifiable system, where the root is read-only and no user can modify anything important.

Which is nice and all, but that implies a "parent" system that creates and deploys those systems. Which people likely want remote access to.. Probably by sshd...

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (13)

kbolino 5 months ago | root | parent | next [–]


You don't have to have an immutable system.

You can limit the exposure of the system from RCE in sshd with SELinux without preventing legitimate users from administering the system.

Granted that SELinux is overly complicated and has some questionable design decisions from a usability standpoint but it's not as limited or inflexible as many seem to think.

It really can stop a system service running as "root" from doing things a real administrator doesn't want it to do. You can couple it with other mechanisms to achieve defense in depth. While any system is only as strong as its weakest link, you can use SELinux to harden sshd so even with exploits in the wild it's not the weakest link vis-a-vis an attacker getting full unconfined root access. This may or may not be worth your time depending on what that box is doing and how connected to the rest of your infrastructure it is.

There seems to be a pervasive misunderstanding of the difference between standard UNIX/Linux discretionary access control and SELinux-style mandatory access control. The latter cannot be fooled into acting as a confused deputy anywhere near as easily as the former. The quality of the SELinux policy on a particular system plays a big part in how effective it is in practice but a good policy will be far harder to circumvent than anything the conventional permissions model is capable of.

Moreover, while immutability is obviously an even stronger level of protection, it is not necessary to make the system immutable to accomplish what I've described here while still allowing legitimately and separately authenticated users to fully administer the system.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (14)

eto-san 5 months ago | root | parent | next [–]


Exactly! Very well done explaning!

Most people turn SELinux off anyway, so they have no clue how it operates.

DACs (discretionary, unix perms) are DACs and MACs (mandatory, SELinux) are MACs. They are mandatory - it's in their name.

Think of SELinux as completely orthogonal access control system, that can overturn any DAC decision, which it in fact does. SELinux language is much more featured than DAC language, it can express domain transitions.

Nobody here has inspected the sshd_t policies but I believe exec transition should be forbidden for arbitrary binaries (I hope).

That should in essence thwart arbitrary exec from remote key payload.If actual shellcode would be sent though (e.g. doing filesystem open/write/close), that is a little bit different.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (15)

treasy 5 months ago | root | parent | prev | next [–]


SELinux is overly complicated, but it’s not hard to at least grasp the basics

The amount of people confusing DAC and MAC is concerning. You’ve done an excellent job explaining the topic.

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (16)

treasy 5 months ago | root | parent | prev [–]


Those files would be editable by something in the sysadm_t domain which is by default the domain of the root user after a successful authentication

This backdoor does not bypass remote authentication so it should be able to transition to the new domain that has access to these files

Even though sshd must run as root (in the usual case), it doesn't need unfettere... (17)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Even though sshd must run as root (in the usual case), it doesn't need unfettere... (2024)
Top Articles
How To Convert Visa Gift Card to Cash Instantly
Digital wallets: A treasure trove of opportunity or risk? | Payments Intelligence
Analysis: Blue Jackets prospects get the job done in Buffalo | Columbus Blue Jackets
Walmart Takes on Abercrombie with Relaunch of No Boundaries
Fhsd Lunch Menu
Tamilblasrer
Grammy Winner Lipa Wsj Crossword Clue
Qhc Learning
Examples of "Crocodile" in a Sentence
Houses for Rent in Sarasota-Bradenton, FL - 183 Rental Homes | Zumper
Is Jackson On Jeopardy Transgender
Huffington Horoscope Cancer
Greenville Mississippi Craigslist
List of Amazon Fulfillment Center Locations [2024 Updated]
Top 5 Online Study Websites and Virtual Work Spaces - MyStudentHQ
Oldeuboi Showtimes Near Marcus Ronnie's Cinema
Stephanie Palomares Obituary
Kfvs12 Weather Radar Near Poplar Bluff Mo
Allmovieshub. In
Getting Started With Python IDLE – Real Python
Th 8 Best Army
10 Bedroom Airbnb Kissimmee Fl
Thule Racks & Gear - Rack Attack
Scammer phone number lookup. How to check if a phone number is a scam
Hannibal Mo Craigslist Pets
Dallas Cowboys On Sirius Xm Radio
Paul Mccombs Nashville Tn
Blairsville Online Yard Sale
Marshall School District (2024-25) - Marshall, MO
Sams La Habra Gas Price
Driving Directions To Target Near Me
Cs2 Feels Like 60Hz
Aloys Total Flying Distance In Horizon Forbidden West
Ozark/Nixa 12 Movie Showtimes & Tickets | Ozark Movie Theater - B & B Theatres
Isabella Lauren Leak
Cargo Pro Stealth 7 x 14 V-Nose Aluminum Enclosed Trailer
R/Sellingsunset
Haunted Mansion (2023) | Rotten Tomatoes
The Victors Boards2Go
Tiger Island Hunting Club
What Is Njvpdi
Craigslist Horse For Sale By Owner
Dutchess Cleaners Boardman Ohio
Gogoanime Bleach Tybw
Netid.unm.edu
Schmeeckle Reserve Death
Spiraling Spirit Leak
R/Mommit
John Deere 2520 For Sale Craigslist
Mcdonalds Russell
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 5980

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.