Skip to content

Revert the capability set, and say what isolated mode bounds - #85

Merged
benoitc merged 1 commit into
mainfrom
revert-caps
Sep 1, 2026
Merged

Revert the capability set, and say what isolated mode bounds#85
benoitc merged 1 commit into
mainfrom
revert-caps

Conversation

@benoitc

@benoitc benoitc commented Sep 1, 2026

Copy link
Copy Markdown
Owner

caps promised to bound what an isolated child may reach and could not keep the promise. Enforcing it inside CPython means an audit hook, and an audit hook never sees a C extension calling open(2), which is most of the code you run isolated mode for. It also cannot tell which directory a relative path resolves against, because the open event does not carry dir_fd, so path containment could be walked around with documented calls and a grant the caller was given. That is not fixable in Python, and a feature shaped like a security control that is not one is worse than no feature.

This reverts it. The tree returns to 5.0.0 exactly.

What replaces it is the truth, in the two guides where someone would look: the child holds every authority the user running the node holds, isolated mode bounds what Python may consume rather than what it may reach, and the mechanisms that do bound reach are the ones the operating system already has around the node (a container or jail, a separate user, a systemd unit with ProtectSystem and IPAddressDeny). Kernel sandboxing per context would let the library express it directly and is not implemented.

Enforcing what a child may reach from inside CPython does not
work: an audit hook never sees a C extension, and the open event
does not say which directory a relative path resolves against, so
the containment could be walked around with documented calls. The
tree returns to 5.0.0 and the guides say plainly that the child
holds every authority the node's user holds, with the operating
system mechanisms that do bound it.
@benoitc
benoitc merged commit 581f3fa into main Sep 1, 2026
20 checks passed
@benoitc
benoitc deleted the revert-caps branch September 1, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant