-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Git master] Vulnerable to privilege escalation using ioctls TIOCSTI and TIOCLINUX #13
Comments
I'm aware of this issue, but I don't see if there is anything sane I can do on my side. Plain setsid will break stuff, if I remember correctly. Proxying ptys is too fragile and inefficient as it requires dealing with signals. seccomp/bpf - absolute no go due to non-portable nature. |
Hi @illiliti, thanks for your reply! I agree that getting the PTY approach right is non-trivial. When you say inefficient, what kind of inefficiency do you have in mind? If it's about the signals, I'm not sure I see the connection yet. Could you elaborate? |
polling ptys, reading/writing from/to ptys, SIGWINCH/SIGCHLD handling, ... This all looks pretty inefficient to me and strictly speaking smells like a hack than actual solution. If I was in charge to fix this problem, I would drop TTY subsystem altogether(as well as escape sequencies, VT, TUIs and all other legacy crap) and start from scratch taking into account past design mistakes. But I'm not in charge and backwards compatibility is still a thing, so, I don't see simpler solution other than to disable these ioctls in kernel. Perhaps only for suid binaries(and propogate to childs of course) in order to not break everything at once. |
@illiliti thanks for elaborating. Personally by now I believe that use of a PTY is a non-hack solution in the sense that a process running with different permissions should not be granted access to the controlling terminal in the first place, an putting a PTY in between is gets separated what should be separate, the PTY fixes that mis-grant of permission. How would you like to proceed with this ticket? |
Maybe I'll poke around and try to simplify that pty solution to acceptable level, but I highly doubt that is right direction towards fix. I'm convinced that solution lies down in kernel because userspace is not appropriate place for it due to a lot of fragile signal-heavy code being needed to implement it correctly which should give you a sign that you are doing something wrong and you should stop right now. Nevertheless, I'll keep this open until the issue peter out itself, or I implement workaround which again is highly unlikely. |
@illiliti thanks for keeping it open 🙏 |
Hi!
I believe that ssu is vulnerabily to privilege escalation using ioctls
TIOCSTI
andTIOCLINUX
. Here is how to see it in action:Please note that:
TIOCSTI
andTIOCLINUX
comfortably.Best, Sebastian
The text was updated successfully, but these errors were encountered: