OSG-SEC-2023-05-31 UPDATE on setuid-mode Apptainer exploit
Dear OSG Security Contacts,
This announcement is an update to last month's OSG-SEC-2023-04-26 HIGH setuid-mode Apptainer exploit [1] regarding a use-after-free flaw in the kernel to all local users. There's an addendum to the v1.1.8 Apptainer security announcement with additional details about the vulnerability which extends urgency to all current operating systems, not only older ones [2].
IMPACTED VERSIONS:
Apptainer v1.1.7 and earlier
All versions of Singularity
WHAT ARE THE VULNERABILITIES:
Use-after-free flaws in the kernel can be used to attack the kernel for denial of service and potentially for privilege escalation. There is an ext4 use-after-free flaw described in CVE-2022-1184 [4][5][6][7] that is exploitable through versions of Apptainer < 1.1.0, installations that include apptainer-suid < 1.1.8, and all versions of Singularity in their default configurations on operating systems where that CVE has not been patched. That includes Red Hat Enterprise Linux 7, Debian 10 buster (unless the linux-5.10 package is installed), Ubuntu 18.04 bionic and Ubuntu 20.04 focal.
UPDATED INFO: additional similar ext4 vulnerabilities have been discovered that are not yet patched on most operating systems including RHEL8, RHEL9, Debian 11, and Ubuntu 22.04.
WHAT YOU SHOULD DO:
Review the Apptainer advisory [2] and update Apptainer to v1.1.8.
UPDATED INFO: All sites that are using setuid-root mode in Singularity or Apptainer should update urgently.
The updated packages can be found on the Apptainer github repository [3], and are available in the epel-testing repository for distributions that can make use of EPEL.
The following workarounds are also available:
-
Either do not install apptainer-suid (for versions 1.1.0 through 1.1.7) or set allow setuid = no in apptainer.conf (or singularity.conf for singularity versions). This requires having unprivileged user namespaces enabled and except for apptainer 1.1.x versions will disallow mounting of sif files, extfs files, and squashfs files in addition to other, less significant impacts. (Encrypted sif files are also not supported unprivileged in apptainer 1.1.x.)
-
Alternatively, use the "limit containers" options in apptainer.conf/singularity.conf to limit sif files to trusted users, groups, and/or paths. (The option "allow container extfs = no" disallows mounting extfs overlay files but does not disallow mounting of extfs overlay partitions inside SIF files, so it does not help work around the problem.)
REFERENCES
[1] https://osg-htc.org/security/vulns/OSG-SEC-2023-04-26/
[2] https://github.com/apptainer/apptainer/security/advisories/GHSA-j4rf-7357-f4cg
[3] https://github.com/apptainer/apptainer/releases/tag/v1.1.8
[4] https://nvd.nist.gov/vuln/detail/CVE-2022-1184
[5] https://access.redhat.com/security/cve/cve-2022-1184
[6] https://security-tracker.debian.org/tracker/CVE-2022-1184
[7] https://ubuntu.com/security/CVE-2022-1184
Please contact the OSG security team at [email protected] if you have any questions or concerns.
OSG Security Team