Don't disable nested, it's still better security than everything else, and having it on means access to real hardware virtualization. Second, the article is AI-written. It really should be rewritten by a human.
I think the use case is that you buy a VM from someone and you also want to run VMs. You wouldn't design your own infrastructure to run VMs inside VMs, but you might already be inside a VM, and want to run VMs.
Oh, sure, there are few limits to the ways you can work around a broken organizational design with a bad technical design. But if nested VMs are the answer then I think you're probably asking the wrong question.
Running a few containers inside a kubernetes cluster that you don't manage, is not that an usual a setup in SaaS things. You don't get full insight into someone else's stack.
That's usually nested, and either cri-o or... KVM.
I mean, nested virtualization allows your containers to implement virtualization-based security. Defense in depth -- more layers for an exploit to have to penetrate.
> I have yet to hear a compelling use case for nested virtualization.
AWS instances are slow to launch; they take whole seconds. Nested virtualization allows running something like firecracker/crosvm/rust-vmm atop a normal AWS instance, without needing a bare-metal one.
If you're segregating internal workloads, by all means use nested virtualization on EC2 or DO or something. Your threat model is different and you probably have a lot more room to maneuver when a KVM escape is announced, because you have some level of trust in all your workloads.
If you're running multitenant for mutually-untrusting customers, that excuse goes out the window.
Do you mean that you would run each tenant on separate (physical) hardware? If so, I presume that you enforce this only for workloads where you run code outside your control.
I guess the average SaaS does not install hardware boxes for each tenant separately.
Also, how could VPS hosting still be a thing if KVM is that easily escaped?
EDIT: I am talking about KVM in general, not nested virtualization.
No, we're generally always talking about multitenant shared hardware, and then the different things you're "sharing" within that hardware --- a kernel (no virtualization), a hypervisor (KVM), two hypervisors (nested KVM). Note that the "extra" hypervisor isn't the big problem with nested KVM.
One distinction I'd make as well is "are you running more than one customer's workload on the same system" (yikes, don't), vs "are you using nested virt as additional protection rather than running the customer workload directly on an instance, but one instance only gets jobs from one customer".
Another good point, but this one is maybe a little less dispositive than it looks like: it's very difficult to engineer an orchestration system that reliably segregates worker physicals from each other, so I'd rate the likelihood of a game-over situation after a guest->host escape as very high regardless of how yuo schedule workloads. It's sort of the same situation as how SSRF's are usually game-overs (you're pivoting from a hardened attack surface to a much softer one) but even harder to engineer again.
Do your lambda functions always get a per-customer dedicated instance or is firecracker distributing them so that multiple customers can have VMs on the same actual box?
Sounds like it would be pretty expensive for Amazon to dedicate an instance to every customer, especially for those with small workloads.
If that's the case, why would it not hold for Amazon but would hold for everyone else?
If you need as-fast-as-possible guest start, AND you have to be on AWS, AND you can't use any of their native microVM-based services, AND you can't use the bare-metal instances - whether due to cost or some other reason, then nested virtualisation might be the least-bad option. That doesn't make it compelling.
Security primitives which don’t nest are fundamentally a bad API design.
Sometimes that’s justified in the name of making the security code simple enough to reason about, but making it harder to use has a security cost also.
I have been a multiple times been on a guest VM on on-premise infra where microvms were used with nested virtualization for exactly this purpose. The setups don't have a AWS Lambda to fallback too nor do they just get to have access to the hypervisor/bare metal.
This was gVisor in kvm-mode and qemu inside containers for integration tests. The main reason here is cost, it is very compelling for getting more out of a hypervisor setup.
What's the usecase for this? You're already paying for the instance to be up but it's being deliberately under-utilised in case you have to start a VM?
Links to a CVE record. The kernel project marks everything that could conceivably be of any use to an attacker as a CVE. What are we actually looking at here? Sounds like a dangling-pointer type of bug?
Not necessarily. Only if you assume that no new insecure code is added. If ai found 1 security bugs in old code but ease of code generation with ai adds 2 new security issues (in unrelated code), then we are getting less secure.
Is it a given that it's as good at outputting secure code as it finding insecure code? That leaves a fair amount of room for people not baking in deep review steps. Also mentioned elsewhere, but if velocity is way up...that ramps up bugs anyway.
But that should be part of your pipeline, no? Personally, the thing I've spent the most time working on with AI is.. a stack to get AI to keep a project on track and follow strict code writing standards that are reviewed. Not everyone is working in that, but I'm sure any serious development will be done via something similar.
Although, at the pace of improvement, I'd bet it won't even be necessary in a year or so.
This is true for human written code too. This is why in the future all written code MUST be run through an internal security sweep before being given to your harness for writing. That's just basic due diligence at this point.
Yes but LLMs famously produce vastly more code than humans. My hot take: LLMs will produce more insecure code than they can catch, and will also find ways to smuggle insecure code to avoid extra work.
Do we have any evidence around the rate that AI emits security bugs vs humans previously? You would think that perhaps AI would be better about this, but perhaps not.
I'm making no claims. I'm just saying that contributing before ai was difficult so people rarely did it. Now that contributing is easy, more code will be added. More code = more bugs. Always.
I've run Daybreak against my human written pre-AI code and found so much stuff that I don't trust human or AI written code. It all MUST be audited by a security sweep AI.
Sure, some projects are trying to be responsible or are trying to keep waves of slop PR's from drowning them, but that is by no means an indication of a general distaste for AI code. It's been largely embraced.
Even if Fable and Astra are superhuman at identifying and fixing bugs that does nothing when projects get bugslopped faster and cheaper by some low-end model.
I hate these meta conversations on crunchy technical topics and feel like we should be digging into the KVM security model more than this general security prognostication stuff. Having said that, I will hypocritically further this debate by pointing out that the determinant of software security moving forward is not so whether AI is drastically better than humans at avoiding common vulnerability patterns, (or instead just a little better). Rather, it's that AI will make it much easier to move subsystems or whole projects to memory-safe programming languages and towards formal verification.
...if the pace of both fixing and finding bugs got accelerated, all we're in for is machines being on average more vulnerable (because patching takes time and effort and more bugs increases that)
It can be, if the intent is for transmission of information or truth. This is at the heart of any propaganda, for example, where the style and medium of messaging are of top importance. Or see the “abc conjecture” and how a gap in communication means that we (or, the math community) are not sure if the conjecture is true or not. The “underlying information” is static, but is essentially null if it cannot be communicated.
If it was valuable a human would have been able to communicate it in a few lines of text. Using a LLM to blast slop devalues everything and communicates little. A drunken twitter rant has more ability to convey information than sloppy blog posts with 3 pieces of information per sentence and a load bearing attitude.
OP (me) was not the author but I generally agree - a well written or at least better edited summary as a preamble would have been preferable, however it's educational to see the process and a potential repro of the issue don't you think?
Of course I imagine they used AI to find the exploit, and the documentation may have come as an output from that process.
At first, there were just big logic blocks and storage that did as they were told.
Later, in hardware, there were all sorts of optimizations built in where the logic would do its own thing -- so you'd get caches and speculative execution and even on-the-fly conversion from one instruction set to another.
This abstraction was also piled onto the runtime -- you'd write machine code, then assembly, then higher level languages; eventually you'd run in interpreted or just-in-time generated bytecode (hello to Java from UCSD p-System from the 70s and Burroughs machines in the 60s). And of course... operating systems...
Now, we've got machines reading source code (and machine code, and everything in between) and they've got some ability to thing the thing to make it thing. Sometimes correctly (enough to pass existing tests) and sometimes without the ability to express to the human what the thing they thinged was.
But, we're all living in the land of mel and for some it's always been better to go fishing than to pretend to participate.
The "hardware doing its own thing" can be understood. There was this big ideological movement called ECS in the 2010s that was about writing software in ways that actually run well on hardware.
LLMs currently don’t learn, at least in the way most people mean, but I assume you mean the trainers will incorporate the knowledge in future releases.
Glad to see this is the top comment. This is written by Claude, I know because I talk to Claude for 8+ hours a day, and it says stuff like this. I stopped reading the article because of it.
The situation might improve if they were to spend some time and effort documenting how seL4 can be used that way. Last I looked their docs around the hypervisor use case were pretty sparse, had trivial examples that were far from what I'd expect to see in even small production use cases, and kept implying that using VMs wasn't really the seL4 way, and wouldn't you rather rewrite everything native?
Even the most cursory research yields multiple solutions, some of them with commercial support.
They'd hold your hand through the entire process of avoiding being hit with criminal negligence charges whenever something serious happens as a consequence of making Linux's MLoCs your TCB.
As others have stated this is a nested issue. Most unikernel users I know deploy straight to ec2 or gcp. This is going to affect "sandbox" providers more than anything else.
Nested virt on EC2/GCE are vulnerable. Metal instances wouldn’t be, though using nested virt on Nitro Sandbox capable EC2 instances wouldn’t be either.
So this is a tricky one. You can (and should) deploy unikernel workloads on metal and avoid nested virt but this is hard to make economically viable in some cases.
No, not really. Metal instances from cloud providers typically cost the same as their virtualized counterparts.
They only come in large sizes, so they’re much more expensive when you aren’t able to fully utilize the capacity on each instance. It’s easier to binpack and saturate a mixed pool of instance types of various sizes than 24xl metal nodes, especially if you care about spreading your workload instances across multiple nodes to prevent single-node instance failure from having impact.
This was some of my first thinking when I posted the original link - the importance of hardening VMs for agent isolation, and the risk that bugs like this pose in legacy code - especially C codebases.
Well this sucks. So this needs a kernel fix then? Looks like I can disable nested passthrough manually, but am I stuck waiting for downsteam fixes at this point then?
Honestly, this gives me pause on the whole "VM is sufficient for any agentic sandbox environment" theory.
He is right. It’s just that selling bare metal doesn’t scale and we must sell VMs instead, so we can't understand his point.
Since he made that comment there has been numerous virtualization vulnerabilities in KVM, Xen, HyperV, and all other hypervisors as well as all their device virtualization helpers/ecosystem. I fail to see how Theo's statement is anything but 100% right. It's just that we can't live with it because we must sell VMs.
There is a reason you graduate to bare metal, then you graduate to air gapped.
Bare metal has nothing to do with his point. He's comparing cotenant shared kernel to cotenant virtual kernel, and he's wrong: virtualization drastically reduces the attack surface.
Is he? I didn't follow the entire thread, but it doesn't seem to discuss shared kernel, just whether the security of x86 virtualization is real or if it's just a convenient way to run multiple kernels on the same x86 host. If you don't trust x86 virtualization as a security boundary, then you're down to bare metal and hoping that your networking cards and switches don't have some vulnerability too.
Virtualization does reduce the attack surface, but it's still there. This is a thread for a hole in it.
I wouldn't say wildly wrong. I would say virtualization is a lot better than nothing, but that there's a pile of hacks with a pile of vulnerabilities (Spectre/Meltdown come to mind) is undeniable. It's just there's no need to tell people they are stupid or worse for using it.
Mitigations are layered, first not using a shared VPS, and instead running your own bare metal server with something like proxmox to run the containerization.
Those containers could be susceptible to issues between them too, but you at least control the environment and can put more checks and balances in place.
Shared cloud and vps is going to become bumpy and more insecure the next little while. There's no way around it.
Another nested KVM bug. We debated enabling nested KVM for many years, and held the line every time, because the only post-2020 KVM vulnerability we knew of required nested VMs. That decision aged well: we've gotten at least 2 more nested KVM escapes in the last year.
KVM maintainer here. On one hand it's true that nested is the single biggest attack surface in the hypervisor, on the other hand it will be over relatively soon. Considering the LLMs have ~15 years of nested virtualization to catch up with, it's not in an awful state. These bugs are extremely complicated to exploit, which means that the past ten years of fuzzing with syzkaller have already found the low hanging fruit.
Certain Windows features need it unfortunately. Virtualization-Based Security (VBS), Credential Guard, Hyper-V (obviously), and I'm going to say WSL2(?)
Right, sorry, that's a fair point (and Josh Triplett made another fair point earlier). I'm sort of implicitly locked in to the "hosting company" use case here: services running mutually-untrusting isolated workloads for customers.