6 ms·
> Pledge is a goddamn toy and it's hilarious you think otherwise. Pledge isn't going to do ANYTHING to protect, say, a complex database server or any number of
by ori_b 4y ago
> Pledge is a goddamn toy and it's hilarious you think otherwise. Pledge isn't going to do ANYTHING to protect, say, a complex database server or any number of third party programs that need all kinds of access, and require being able to make all types of syscalls.
Here's a program that will run an arbitrary command under the same
restrictions as Chrome. Presumably, Chrome counts as a complex third
party program.
#include <stdio.h>
#include <unistd.h>
#include <err.h>
#define CHROME_MAIN_CONTENT_PLEDGE \
"rpath wpath cpath stdio tmppath dns inet flock "
"unix proc prot_exec tty sendfd recvfd exec mcast "
"ps drm fattr route getpw vminfo video"
int
main(int argc, char **argv)
{
if(argc < 2)
errx(1, "usage: %s cmd\n", argv[0]);
if(pledge(CHROME_MAIN_CONTENT_PLEDGE, CHROME_MAIN_CONTENT_PLEDGE) == -1)
err(1, "pledge");
if(unveil("/var/empty", "r") == -1)
err(1, "unveil");
if(unveil(NULL, NULL) == -1)
err(1, "unveil");
execv(argv[1], &argv[1]);
err(1, "exec");
}
compile as:
cc -o asroot asroot.c
run as:
doas ./asroot your-exploit-command
What exploit command you do use to break out?
- Zurrrrr 4y agoThat isn't the context of the conversation. You really are very disingenuous. How about you show me how you lock down an OBSD system that is running, say Oracle. With pledge.
- ori_b 4y agoYou keep insisting that if you can run pledged and unveiled code as root, you can break out. Let's get that part of the discussion out of the way first, and then I'll happily switch tracks to pledging oracle. Though I'm not sure why you think it'd be much harder than pledging Chrome or Firefox.
- Zurrrrr 4y agoOracle, and third party software was the example I used from the start. SELinux absolutely can protect Oracle or any complex program. If you want t discuss this further, illustrate how pledge can protect against a remote root exploit in Oracle as good or better than SELinux can.
- ori_b 4y agoAgain, can you give an example of an jailbreak you're thinking of? So far, I don't even think you've given a clear explanation of your threat model. Once we have that, we can have a discussion about Oracle fits into it -- but until then, there's no substance. What operations would you use to break out of the above sandbox? Once you give me that, I'll happily discuss the details.
- Zurrrrr 4y agoAgain, from the start, my scenario and example was third party software. Feel free to re-read the thread from the start if you want to confirm that. I'm not interested in retreading anything. I don't even want to continue discussing anything with you as it is, but I'm willing to see where this goes. Show how pledge can protect against a remote root compromise in oracle. I doubt it can, you've been insisting pledge is all OpenBSD needs to protect against such attacks. I'm not answering any more questions or taking any more detours. Stop being intellectually dishonest. Either admit that you don't know for sure that pledge can protect against a remote root compromise in complex third party software like oracle and simply think it can, or show how it can. If you can't do that, we're at an impasse and there won't be further discussion. Unless you post some kind of baiting comment I suppose, which wouldn't surprise me at this point.
- ori_b 4y agoYou exec oracle with an unveil that prevents a compromised oracle from touching any data that you didn't intend, and an exec pledge that removes the ability to open any raw devices other than the ones you handed to it directly. The program upthread will let you do that. It won't be as good as Oracle doing its own pledges, of course, because well pledged programs narrow down their pledge set as they run -- but if you have a binary that you can't modify, this is as good as you can do with any security framework. For example, Linux has landed on the same model as pledge when they added landlock, where a program is expected to landlock itself after opening the initial handles to resources.
- 4y ago