SeguridadNode.jsCapabilitiesConfinamientoArquitectura

Don't claim a security boundary holds — demonstrate it

Published on 2026-08-26 · Xiliux

A system has to run a chunk of code you don't control —a plugin, a dependency, something generated— and you want to guarantee that code cannot touch the file system or spawn processes. Not that it "shouldn't": that it can't, mechanically. That's capability confinement, and it's one of the central problems of runtime security.

Designing it and demonstrating it are two different things, and confusing them is expensive.

A design is a claim

You can write an impeccable document: "access to fs and to spawning processes is controlled like this, with these mechanisms, under this threat model". It's real and necessary work. But it's a claim. And the failure mode of a security boundary is that it looks like it holds until it doesn't —silent, invisible in tests, visible only when someone crosses it—.

In security, an unverified claim has exactly the shape of a beautiful, wrong architecture. The design can assume that a module-loader hook fires at a point where it actually doesn't, and all the reasoning hanging off that is correct and worth nothing.

The mechanisms exist, and there are several

In Node, to name a concrete runtime, there are at least three layers, and they aren't interchangeable:

Choosing well among them is the design. But choosing well doesn't prove the choice holds against the real dependency tree you're going to run.

Demonstrate instead of claim

The alternative to signing off a design is delivering a confinement harness: untrusted code that tries to reach the dangerous capability —open a file, spawn a process— against the real runtime and its real dependency tree, and a log that shows each attempt was blocked. Or, if something escapes, exactly where.

The difference isn't cosmetic. "I think it's confined" and "here's the evidence that an attempt to read a system file from the plugin returned permission denied" are claims of very different weight. The second is the discipline I use for everything else applied to security: cross the program boundary and measure what comes out, not what you think comes out.

The honest part

There's a temptation to sign off the boundary from an authority you haven't earned —because the design looks good, because the mechanisms exist—. The honest discipline is the opposite: what you can back today, you back; what depends on a runtime detail you don't master, you don't assert from memory: you validate empirically, and what can't be demonstrated yet is marked as the seam to co-review, not hidden.

A demonstrated boundary covers exactly the gap a claimed one leaves open. And for whoever has to trust the confinement, a harness that attacks its own boundary and keeps the evidence is worth more than the word of whoever designed it.

FAQ

What is capability confinement?

Controlling what a fragment of code can reach: reading or writing files, spawning processes, opening the network. Instead of trusting the code to behave, you mechanically deny it access to the dangerous parts, so it can't touch them even if it wants to.

What mechanisms exist, for example in Node?

The native permission model (--permission, --allow-fs-*) at the process level; SES / Hardened JavaScript (Compartments, lockdown()) to confine what each module imports; and module-loader interception. Each covers a distinct layer and they aren't interchangeable.

Why demonstrate and not claim?

Because the failure mode of a boundary is silent: it looks like it holds until it doesn't, and it doesn't show in tests. A harness that fires the attack against the boundary itself and keeps the result turns 'I think it holds' into 'here's the evidence that it holds'.

What if you don't master the runtime internals?

That's the honest part: you don't assert from an authority you haven't earned. What you can back today, you back; what depends on a runtime detail you don't master you validate empirically against the real runtime, and what can't be demonstrated yet is marked as a seam to co-review, not hidden.

← More articlesRequest a quote