---===[ Qubes Security Bulletin 119 ]===--- 2026-09-15 Potential attacker-controlled format string in qvm-open-in-vm User action ------------ Continue to update normally [1] in order to receive the security updates described in the "Patching" section below. No other user action is required in response to this QSB. Summary -------- Under certain circumstances (see "Technical details" below), if the user invokes qvm-open-in-vm (either directly or through the "Edit in disposable qube" GUI integration) on a file with an attacker-controlled filename or path, the attacker might be able to execute code in the qube in which the user invoked qvm-open-in-vm. Impact ------- An attacker who successfully exploits this vulnerability can take control over the qube in which the user invoked qvm-open-in-vm. Affected systems ----------------- All supported Qubes OS releases are affected. Among official Qubes OS templates, only Debian templates are affected. Technical details ------------------ When qvm-open-in-vm is invoked with a file (not an URI), the source-side part of the qrexec call is handled by the qopen-in-vm helper program. After sending the file content to the other side, qopen-in-vm tries to open a temporary file alongside the original file in order to save the response in case the user has edited the file in the target qube. If creating this file fails (e.g., because the directory is read-only), qopen-in-vm creates a temporary file in /tmp and shows an error message to the user. When printing this error message, it incorrectly invokes the gui_nonfatal function, such that the original filename ends up in a printf format string, which is unsafe. For this vulnerability to be exploitable, multiple conditions must be fulfilled: 1. The attacker must trick the user into using qvm-open-in-vm to open a file that either a. has a filename (i.e., the last component of the file's path) longer than 248 bytes or b. is located in a directory that is not writable. 2. The path (but not necessarily its last component) must contain printf-style conversion specifiers (such as '%n'). 3. qvm-open-in-vm must not have been invoked with the --view-only flag. 4. The target qube must either a. send back the file content because its mtime changed (which usually happens because the user saved the file being edited, even if merely by overwriting it with the same content) or b. be compromised by the attacker. 5. The build of qvm-open-in-vm must have been compiled without _FORTIFY_SOURCE hardening enabled (or set to a level below 2). Due to an unfortunate interaction between our build script and the way Debian handles this option, this hardening was not enabled for our Debian packages. (This problem did not affect our Fedora packages, for which the hardening was correctly enabled.) With enabled hardening, the program safely aborts with an error, making the bug unexploitable. The first person to report this vulnerability tested its exploitability on his system. He found that it was successfully exploited in less than 3 % of attempts. Moreover, his demonstration required a very long path with multiple nested directories and that contained many format specifiers. In the real world, the attacker may control only the last part of the file name in most cases. And even when they do control the full path, many users would likely find such a path suspicious, which would likely make it more difficult for an attacker to successfully trick the user into opening such a path. Discussion ----------- Normally, we do not issue Qubes security bulletins for purely "in-VM" vulnerabilities (like this one) that do not involve crossing the VM security boundary. However, we have decided to make an exception in this case, since this is a bug in our code and since qvm-open-in-vm is specifically intended to operate on untrusted input. While qvm-open-in-vm is designed to be hardened, keep in mind that handling less trusted data in a more trusted VM still can be risky for other reasons, for example: - Unsafe handling of attacker-controlled paths is an easy mistake to make in the shell. - A file explorer could render the thumbnail of an untrusted file with a buggy parser. - You might accidentally open the file with an application other than qvm-open-in-vm, exposing the full attack surface of that application. Patching --------- The following package contains the security update that addresses the vulnerability described in this bulletin: For Qubes 4.3, in affected templates and standalones: - qubes-core-agent version 4.3.48 This package will migrate from the security-testing repository to the current (stable) repository over the next two weeks after being tested by the community. [2] Once available, the package should be installed via the Qubes Update tool or its command-line equivalents. [1] In order for this security update to take effect, all affected templates must be updated with the package above, then shut down. Afterward, all qubes based on these templates (including disposables) must be restarted. All affected standalones must be updated with the package above. Credits -------- This vulnerability was first reported by Giulio Berra. Shortly after, it was independently reported by Rafal Wojtczuk. References ----------- [1] https://doc.qubes-os.org/en/latest/user/how-to-guides/how-to-update.html [2] https://doc.qubes-os.org/en/latest/user/downloading-installing-upgrading/testing.html -- The Qubes Security Team https://www.qubes-os.org/security/