REDHAT-BUG-2530542: High severity bubblewrap vulnerability
A flaw was found in bubblewrap. During sandbox setup the host filesystem is mounted at /oldroot and the sandboxed root is mounted at /newroot. When bubblewrap creates a file or directory under /newroot, it can follow a parent symlink that points at /oldroot, causing that object to be created on the host instead of inside the sandbox. This occurs during setup, before any sandboxed process is running. Created files use the uid and gid of the user that launched bubblewrap, which is typically unprivileged. The issue affects Flatpak when a malicious or compromised application image is used, and can affect other frameworks that create files on untrusted content with bubblewrap. This vulnerability is tracked by upstream as GHSA-pxhw-h44j-8pfx. It is fixed in bubblewrap 0.12.0 by resolving paths with openat2 and RESOLVEINROOT.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
bubblewrapto a version that resolves this vulnerability.Fixed in 0.12.0Patch GHSA-pxhw-h44j-8pfx
Event History
Frequently Asked Questions
Who is realistically exposed to this flaw?
Flatpak is affected when it processes a malicious or compromised application image. Other frameworks may also be affected if they use bubblewrap to create files from untrusted content.
What must an attacker control to exploit it?
The attacker needs untrusted content that causes bubblewrap, during sandbox setup, to create a file or directory beneath a parent symlink pointing to /oldroot. The resulting object is created on the host filesystem rather than inside the sandbox.
Does exploitation require code to already be running inside the sandbox?
No. The issue occurs during bubblewrap sandbox setup, before any sandboxed process is running.
What host-level access does successful exploitation provide?
Files or directories can be created on the host filesystem, but they use the UID and GID of the user who launched bubblewrap, which is typically an unprivileged user.
What version contains the described fix?
The issue is fixed in bubblewrap 0.12.0, which resolves paths using openat2 with RESOLVE_IN_ROOT.