Skip to content

Complete fix of a privilege escalation exploit in the sudo configuration of Knockd (followup to #3472) #3476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

peri123214
Copy link

@peri123214 peri123214 commented Jun 1, 2025

As @jasperchess said in the original pull request, sudo access to knockd can be used for privilege escalation within the container. He has submitted a hotfix that was intended for the time until I patched the image in its entirety. My branch splits the runtime of the server to two users, one is for the Minecraft JAR (user minecraft) and the second one is for the tasks that use knockd to operate (namely Autopause and Autostop, username service-account). Service account has the same privileges as the minecraft account had before.

@itzg
Copy link
Owner

itzg commented Jun 1, 2025

Did you see that sudo is no longer needed for knockd in #3472 ?

@jasperchess please pair up on this.

I'm rapidly quite annoyed with knockd and will rip it all out if all this other stuff is needed to accommodate.

@itzg
Copy link
Owner

itzg commented Jun 1, 2025

BTW I didn't intend that PR as a hotfix...or did it break all of autopause?

@itzg
Copy link
Owner

itzg commented Jun 1, 2025

I'm removing sudoers file entirely in #3477

@peri123214
Copy link
Author

BTW I didn't intend that PR as a hotfix...or did it break all of autopause?

The fix that jasperchess proposed would work, but only for servers with autopause/autostop disabled as enabling the feature would also enable the exploit. However the removal of sudoers is also a way of fixing it, so I will close this pull request. You can, however, reopen it if you have any further questions. Thanks for your time and effort in the entire manner!

@peri123214 peri123214 closed this Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants