Remix.run Logo
pixl97 17 hours ago

>what an attacker actually wants to do after landing on your box.

Aren't there ways of overwriting the existing kernel memory/extending it to contain an a new application if an attacker is able to attack the running unikernel?

What protections are provided by the unikernel to prevent this?

eyberg 17 hours ago | parent | next [-]

To be clear there are still numerous attacks one might lob at you. For instance you if you are running a node app and the attacker uploads a new js file that they can have the interpreter execute that's still an issue. However, you won't be able to start running random programs like curling down some cryptominer or something - it'd all need to be contained within that code.

What becomes harder is if you have a binary that forces you to rewrite the program in memory as you suggest. That's where classic page protections come into play such as not exec'ing rodata, not writing to txt, not exec'ing heap/stack, etc. Just to note that not all unikernel projects have this and even if they do it might be trivial to turn them off. The kernel I'm involved with (Nanos) has other features such as 'exec protection' which prevents that app from exec-mapping anything not already explicitly mapped exec.

Running arbitrary programs, which is what a lot of exploit payloads try to achieve, is pretty different than having to stuff whatever they want to run inside the payload itself. For example if you look at most malware it's not just one program that gets ran - it's like 30. Droppers exist solely to load third party programs on compromised systems.

ignoramous 15 hours ago | parent [-]

> The kernel I'm involved with (Nanos) has other features such as 'exec protection' which prevents that app from exec-mapping anything not already explicitly mapped exec.

Does this mean JIT (and I guess most binary instrumentation (debuggers) / virtualization / translation tech) won't run as expected?

eyberg 15 hours ago | parent [-]

We don't enable that exec-protect feature on by default explicitly for this reason. You are right - jit needs it.

wmf 17 hours ago | parent | prev [-]

If the stack and heap are non-executable and page tables can't be modified then it's hard to inject code. Whether unikernels actually apply this hardening is another matter.

catlifeonmars 13 hours ago | parent [-]

Isn’t this where ROP gadgets come in?

wmf 12 hours ago | parent [-]

ASLR defeats ROP. Whether unikernels actually use ASLR is another matter.