REDHAT-BUG-2585329: High severity Flatpak Flatpak vulnerability
If an app, runtime or extension installed system-wide uses the Flatpak extra-data mechanism, and its applyextra program creates a very deeply nested directory hierarchy, flatpak-system-helper can fail while canonicalizing permissions (for example with EMFILE when exceeding open-file limits). In affected versions, that failure path can still be treated as success, leaving a setuid-root executable under /var/lib/flatpak whose setuid bit was not cleared. A local user cooperating with a malicious or compromised system-wide app/runtime/extension, or an app that can already run code as the user, can use that executable to escalate to root. Fixed in Flatpak 1.18.6 and 1.19.4 (1.18.5/1.19.3 tags also contain the fix but those releases failed and were superseded). Backports exist on the unsupported flatpak-1.16.x git branch; there is no formal upstream 1.16.x security release.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.18.6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.19.4
Event History
Frequently Asked Questions
Who can exploit this issue?
Exploitation requires a local user to cooperate with a malicious or compromised system-wide Flatpak app, runtime, or extension that uses extra-data, or an app that can already run code as that user. The impact is local privilege escalation to root.
Are all Flatpak installations affected by default?
The issue is relevant when a system-wide app, runtime, or extension uses the Flatpak extra-data mechanism and its apply_extra program can create a deeply nested directory hierarchy. The supplied information does not state that ordinary Flatpak installations without this condition are affected.
Which versions contain an upstream fix?
The issue is fixed in Flatpak 1.18.6 and 1.19.4. The 1.18.5 and 1.19.3 tags contain the fix but their releases failed and were superseded; backports also exist on the unsupported flatpak-1.16.x git branch, without a formal upstream 1.16.x security release.
What indicates that a system may have been exposed?
A relevant failure occurs when flatpak-system-helper cannot canonicalize permissions, for example due to EMFILE from open-file limits, but treats the failure as successful. This can leave a setuid-root executable under /var/lib/flatpak with its setuid bit still present.