Skip to content

bubblewrap: Add --not-a-security-boundary flag to enable fail-open behavior#751

Draft
ao2 wants to merge 1 commit into
containers:mainfrom
ao2:ao2/not-a-security-boundary
Draft

bubblewrap: Add --not-a-security-boundary flag to enable fail-open behavior#751
ao2 wants to merge 1 commit into
containers:mainfrom
ao2:ao2/not-a-security-boundary

Conversation

@ao2
Copy link
Copy Markdown
Contributor

@ao2 ao2 commented May 7, 2026

Some callers of bwrap (e.g. xdg-dbus-proxy, Steam Runtime) use it purely to adjust filesystem layout, without any expectation of a security boundary between the sandbox and the host.

For these callers, hard failures during sandbox setup (such as an automount timeout on a bind source) are unnecessarily fatal.

So add a new --not-a-security-boundary option that can be used to relax the bubblewrap behavior in these specific cases, and allow it to "fail-open".

@ao2 ao2 changed the title bubblewrap: Add --not-a-security-boundary flag to enable fail-open … bubblewrap: Add --not-a-security-boundary flag to enable fail-open behavior May 7, 2026
@ao2
Copy link
Copy Markdown
Contributor Author

ao2 commented May 7, 2026

cc @smcv even though it's still a draft

Comment thread bubblewrap.c Outdated
Comment on lines +925 to +926
* Maybe we want to handle opt_not_a_security_boundary inside bind_mount
* itself?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that would be a better place to do it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v2 now splits the logic in two parts:

  1. To what operation we want to apply the new "fail open" behavior? In bubblewrap.c
  2. To what step of bind_mount to we want to "fail open"? In bind_mount.c

The new version seems more robust, even though I am not sure I like printing the warn() directly in bind_mount().

…behavior

Some callers of bwrap (e.g. xdg-dbus-proxy, Steam Runtime) use it purely
to adjust filesystem layout, without any expectation of a security
boundary between the sandbox and the host.

For these callers, hard failures during sandbox setup (such as an
automount timeout on a bind source) are unnecessarily fatal.

So add a new `--not-a-security-boundary` option that can be used to
relax the bubblewrap behavior in these specific cases, and allow it to
"fail-open".

In the first implementation enable the "fail open" behavior only to the
case where bwrap fails to remount a submount with different flags during
a `--bind` or `--bind-fd` operations, and still "fail close" for
operations like `--dev-bind` and `--ro-bind` which are supposedly more
critical.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
@ao2 ao2 force-pushed the ao2/not-a-security-boundary branch from e64137e to 418a4f1 Compare May 11, 2026 16:29
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.

2 participants