Live data from Hacker News

Abusing Ubuntu 24.04 features for root privilege escalation

snyk.io

41–50 of 83 posts

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#41

Earlier quoted context omitted.

Nope, not on my system: https://i.imgur.com/1qCLXXZ.png

Great, now you can start putting your customizations in that directory instead of the OS-managed /etc/ssh/sshd_config blob. That's why the `.d/` convention exists.

What does .d imply?

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#42

24.04 also ships with a footgun that keeps PasswordAuthentication enabled even if you edit /etc/ssh/sshd_config. It adds a /etc/ssh/sshd_config.d/50-cloud-init.conf that force overrides any PasswordAuthentication settings you have configured in /etc/ssh/sshd_config. See here: https://news.ycombinator.com/item?id=42133181

A better practice is to use the `.d/` convention as intended - so you can have overrides and customizations without having to edit the OS-managed /etc/ssh/sshd_config file and fight it if an OS upgrade changes it.

Edit: It's not really a mistake on Ubuntu's part, and is common in other distros for overriding upstream defaults[1].

[1]: https://askubuntu.com/a/1516347

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#43
post #38
post #35

Earlier quoted context omitted.

Well it's your lucky day, they're working on rearchitecting cups to be, among other things, more secure. See https://ftp.pwg.org/pub/pwg/liaison/openprinting/presentatio...

What if you don't need cups because you don't print anything? Just sudo apt remove cups right? No, because cups is a dependency of the entire graphical subsystem, just removing cups also removes everything from the Nautilus file manager to Firefox to ubuntu-desktop itself.

Any idea why that is?!

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#44

Earlier quoted context omitted.

Great, now you can start putting your customizations in that directory instead of the OS-managed /etc/ssh/sshd_config blob. That's why the `.d/` convention exists.

What does .d imply?

I had to look up the info because I wasn't sure really, so I appreciate the direct question. It means 'directory' or 'conf.d pattern'. So you have your config file, and the config directory that contains "parts" of the config to be merged with the main one to provide customizations/overrides.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#45
post #24

Earlier quoted context omitted.

Now I definitely feel glad that I decided on moving back to Debian for servers.

Does anyone know how to turn off auto updates on Ubuntu 22? I thought I fixed it, but apparently not. It is driving me crazy.

Hey I think you might have replied to the wrong thread or post. This thread/post has nothing to do with Ubuntu 22 updates.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#46

24.04 also ships with a footgun that keeps PasswordAuthentication enabled even if you edit /etc/ssh/sshd_config. It adds a /etc/ssh/sshd_config.d/50-cloud-init.conf that force overrides any PasswordAuthentication settings you have configured in /etc/ssh/sshd_config. See here: https://news.ycombinator.com/item?id=42133181

Is this true for Ubuntu Server 24 as well?

Was thinking of upgrading but not if I can’t configure SSH to be key only

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#47

24.04 also ships with a footgun that keeps PasswordAuthentication enabled even if you edit /etc/ssh/sshd_config. It adds a /etc/ssh/sshd_config.d/50-cloud-init.conf that force overrides any PasswordAuthentication settings you have configured in /etc/ssh/sshd_config. See here: https://news.ycombinator.com/item?id=42133181

Is this true for Ubuntu Server 24 as well? Was thinking of upgrading but not if I can’t configure SSH to be key only

There is nothing broken with Ubuntu, just people not understanding how configuration files work in Linux, choosing to enable password auth in SSH during installation, or using a cloud provider that provisions instances with passwords and overrides the default.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#48

24.04 also ships with a footgun that keeps PasswordAuthentication enabled even if you edit /etc/ssh/sshd_config. It adds a /etc/ssh/sshd_config.d/50-cloud-init.conf that force overrides any PasswordAuthentication settings you have configured in /etc/ssh/sshd_config. See here: https://news.ycombinator.com/item?id=42133181

Now I definitely feel glad that I decided on moving back to Debian for servers.

Err, why? Nothing is actually broken with Ubuntu 24.04. The issue GP is describing is just a lack of understanding of how config files have worked on Linux for decades.

On top of that, this issue doesn't even "ship with 24.04". GP probably chose to enable password auth in SSH during installation, or they used a cloud provider that provisions instances with passwords and overrides the default.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#49

Earlier quoted context omitted.

They can execute anything they like as root... by entering their password. This post shows a way that clever code can execute anything it likes as root without knowing the user's password. That seems pretty significant to me.

Using print server vulnerabilities to gain local privilege escalation is reminiscent of Windows 95. The year of "Linux on the Desktop," I guess.

In fact it's also reminiscent of Windows 11.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#50

Earlier quoted context omitted.

Now I definitely feel glad that I decided on moving back to Debian for servers.

Err, why? Nothing is actually broken with Ubuntu 24.04. The issue GP is describing is just a lack of understanding of how config files have worked on Linux for decades. On top of that, this issue doesn't even "ship with 24.04". GP probably chose to enable password auth in SSH during installation, or they used a cloud provider that provisions instances with passwords and overrides the default.

Any sufficiently poorly constructed system is indistinguishable from a legitimate vulnerability.

You shouldn't need to edit an undocumented file that's force enabling an insecure authentication method in the first place.

"You're using it wrong" doesn't change the fact that the defaults are poor and likely to ultimately cause more devices to be improperly configured than if it was left as sysadmins and end-users expect.

Post reply on HN