CVE-2023-28100 Overview
CVE-2023-28100 is a sandbox escape vulnerability in Flatpak, the popular system for building, distributing, and running sandboxed desktop applications on Linux. This vulnerability allows a malicious Flatpak application running on a Linux virtual console to copy text from the console and paste it into the command buffer, potentially enabling arbitrary command execution after the Flatpak app exits.
The vulnerability exploits the TIOCLINUX ioctl command, similar in nature to CVE-2017-5226 which utilized TIOCSTI. When a Flatpak app runs on virtual consoles such as /dev/tty1 or /dev/tty2, it can manipulate the terminal buffer to inject commands that may execute once the sandboxed application terminates.
Critical Impact
Malicious Flatpak applications can escape sandbox restrictions on Linux virtual consoles, potentially executing arbitrary commands with the user's privileges after the app exits.
Affected Products
- Flatpak versions prior to 1.10.8
- Flatpak versions prior to 1.12.8
- Flatpak versions prior to 1.14.4
- Flatpak versions prior to 1.15.4
Discovery Timeline
- 2023-03-16 - CVE-2023-28100 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2023-28100
Vulnerability Analysis
This vulnerability represents an input validation error in Flatpak's sandbox implementation when running on Linux virtual consoles. The fundamental issue lies in the incomplete isolation of terminal control operations, specifically the TIOCLINUX ioctl system call.
The Flatpak sandbox is designed to restrict applications from accessing sensitive system resources, but it failed to adequately block the TIOCLINUX ioctl command. This command provides various terminal-related functionalities on Linux virtual consoles, including the ability to manipulate the selection buffer and paste content into the input stream.
The vulnerability requires local access and user privileges to execute a malicious Flatpak application. The scope is changed because the vulnerability allows escape from the sandbox container, potentially affecting resources outside the intended security boundary.
Root Cause
The root cause is improper input validation (CWE-20) in the Flatpak sandboxing mechanism. The sandbox failed to block access to the TIOCLINUX ioctl command when applications run on Linux virtual consoles (/dev/tty1, /dev/tty2, etc.). This oversight allows sandboxed applications to interact with the terminal in ways that should be restricted, enabling command injection into the parent shell's input buffer.
Graphical terminal emulators like xterm, gnome-terminal, and Konsole are unaffected because they do not implement the TIOCLINUX ioctl functionality that exists on raw Linux virtual consoles.
Attack Vector
The attack requires local access and involves the following mechanism:
- An attacker creates a malicious Flatpak application
- A user executes the application on a Linux virtual console (not a graphical terminal)
- The malicious app uses the TIOCLINUX ioctl to copy attacker-controlled text
- The app pastes this text into the terminal's command buffer
- After the Flatpak app exits, the injected commands remain in the buffer
- The user may inadvertently execute these commands when they press Enter or the commands auto-execute
The attack is specific to Linux virtual consoles and does not affect users running Flatpak applications in typical graphical environments where Wayland or X11 terminal emulators are used.
Detection Methods for CVE-2023-28100
Indicators of Compromise
- Unexpected commands appearing in terminal history after running Flatpak applications
- Processes spawned from shells on virtual consoles that weren't explicitly initiated by the user
- Flatpak applications making unusual ioctl system calls to /dev/tty* devices
- Suspicious activity logged immediately following Flatpak application termination
Detection Strategies
- Monitor for TIOCLINUX ioctl calls originating from sandboxed Flatpak processes using auditd or similar system auditing tools
- Implement logging of all ioctl operations to virtual console devices from containerized applications
- Use SentinelOne's behavioral AI to detect anomalous terminal manipulation patterns from sandboxed applications
- Audit installed Flatpak applications for untrusted or recently modified packages
Monitoring Recommendations
- Enable kernel audit logging for ioctl system calls targeting tty devices
- Deploy endpoint detection solutions capable of monitoring container escape attempts
- Regularly audit Flatpak application sources and verify package integrity
- Monitor for unexpected command execution patterns on virtual console sessions
How to Mitigate CVE-2023-28100
Immediate Actions Required
- Upgrade Flatpak to version 1.10.8, 1.12.8, 1.14.4, or 1.15.4 depending on your current release branch
- Avoid running Flatpak applications on Linux virtual consoles until patches are applied
- Use graphical terminal emulators (xterm, gnome-terminal, Konsole) instead of raw virtual consoles
- Review and audit currently installed Flatpak applications for potential malicious behavior
Patch Information
Security patches addressing this vulnerability are available in Flatpak versions 1.10.8, 1.12.8, 1.14.4, and 1.15.4. The fix restricts Flatpak applications from accessing the TIOCLINUX ioctl command, preventing sandbox escape through terminal manipulation.
The patch commit is available in the GitHub Commit Update. Additional technical details can be found in the GitHub Security Advisory.
For Gentoo Linux users, see Gentoo GLSA 202312-12 for distribution-specific guidance.
Workarounds
- Do not run Flatpak applications on Linux virtual consoles (/dev/tty1, /dev/tty2, etc.)
- Use Flatpak only in Wayland or X11 graphical environments where standard terminal emulators are employed
- Restrict user access to virtual consoles on systems where Flatpak is installed
- Consider implementing mandatory access control (SELinux/AppArmor) policies to limit ioctl access from sandboxed applications
# Verify your current Flatpak version
flatpak --version
# Update Flatpak to the latest patched version
# For Debian/Ubuntu systems:
sudo apt update && sudo apt upgrade flatpak
# For Fedora systems:
sudo dnf update flatpak
# For Arch Linux:
sudo pacman -Syu flatpak
# Verify the update was successful
flatpak --version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

