Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 905091 (CVE-2023-30549) - <app-containers/apptainer-1.1.8: privilege escalation
Summary: <app-containers/apptainer-1.1.8: privilege escalation
Status: RESOLVED FIXED
Alias: CVE-2023-30549
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo Security
URL: https://github.com/apptainer/apptaine...
Whiteboard: B1 [glsa+]
Keywords:
Depends on: 905115
Blocks:
  Show dependency tree
 
Reported: 2023-04-26 02:51 UTC by John Helmert III
Modified: 2023-11-25 10:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-04-26 02:51:11 UTC
CVE-2023-30549:

Apptainer is an open source container platform for Linux. There is an ext4 use-after-free flaw 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 older 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. Use-after-free flaws in the kernel can be used to attack the kernel for denial of service and potentially for privilege escalation.

Apptainer 1.1.8 includes a patch that by default disables mounting of extfs filesystem types in setuid-root mode, while continuing to allow mounting of extfs filesystems in non-setuid "rootless" mode using fuse2fs.

Some workarounds are possible. 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, and set `allow container extfs = no` to disallow mounting of extfs overlay files.  The latter option by itself does not disallow mounting of extfs overlay partitions inside SIF files, so that's why the former options are also needed.

Patch: https://github.com/apptainer/apptainer/commit/5a4964f5ba9c8d89a0e353b97f51fd607670a9f7

Please bump to 1.1.8.
Comment 1 Marek Szuba archtester gentoo-dev 2023-04-26 12:31:53 UTC
Will be ready for a GLSA as soon as 1.1.8 has been stabilised. And speaking of GLSA:
 - if I am reading this correctly the bug is actually in the kernel and all that apptainer-1.1.8 does is make it more difficult to exploit this, isn't it? Might make sense to think about how to phrase this, assuming we actually NEED a GLSA for apptainer in the first place given the above;
 - likewise, it might be worth mentioning that >=1.1.0 are only affected when emerged with USE=suid, which is a non-default value of this flag.
Comment 2 Larry the Git Cow gentoo-dev 2023-04-26 14:38:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=778c8b1da6041f6b5e8291d1b8daa5f6e269f6f1

commit 778c8b1da6041f6b5e8291d1b8daa5f6e269f6f1
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2023-04-26 14:37:42 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2023-04-26 14:37:42 +0000

    app-containers/apptainer: drop 1.1.6
    
    This leaves only 1.1.8 in the tree.
    
    Bug: https://bugs.gentoo.org/905091
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 app-containers/apptainer/Manifest               |  1 -
 app-containers/apptainer/apptainer-1.1.6.ebuild | 92 -------------------------
 2 files changed, 93 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2023-11-25 10:48:09 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/data/glsa.git/commit/?id=9040219bda064f70fe25f1a8b7fcb4aac9147a22

commit 9040219bda064f70fe25f1a8b7fcb4aac9147a22
Author:     GLSAMaker <glsamaker@gentoo.org>
AuthorDate: 2023-11-25 10:47:30 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2023-11-25 10:48:03 +0000

    [ GLSA 202311-13 ] Apptainer: Privilege Escalation
    
    Bug: https://bugs.gentoo.org/905091
    Signed-off-by: GLSAMaker <glsamaker@gentoo.org>
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>

 glsa-202311-13.xml | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)