Arbitrary code execution when installing or updating Flatpak applications from a malicious OCI registry on 32-bit systems.
The OCI delta stream parser read sizes as guint64 but passed them to GLib I/O and allocation functions expecting gsize (32 bits on 32-bit systems). The silent truncation causes undersized allocations while subsequent operations use the original 64-bit size, leading to heap buffer overflows. An attacker controlling an OCI registry can craft a delta stream that triggers this during flatpak install or flatpak update, potentially achieving code execution in the Flatpak client process.
On 64-bit systems, gsize and guint64 are the same width, so the truncation does not occur and the issue is not practically exploitable.
The issue has been patched in version 1.18.1 by commits:
892d261 "oci: Use gsize for OCI delta sizes"
c52e851 "oci: Avoid overflow in delta_read_data"
f710ca1 "oci: Limit delta path length to PATH_MAX"
For LTS operating system distributions, backports of these changes are available in the flatpak-1.16.x branch.
Only install applications from trusted OCI registries. Flatpak remotes using the default OSTree transport are not affected.
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
