Local privilege escalation in apptainer-suid with --cdi-dirs
Description
Impact
There is a local privilege escalation to root in apptainer-suid versions >= 1.5.0 due to a vulnerability in the --cdi-dirs option.
Patches
The issue is patched in apptainer 1.5.4.
Workarounds
The most sure workaround is to remove the apptainer-suid package and use only the unprivileged apptainer package, if that is an option. An equivalent workaround is to set allow setuid = no in apptainer.conf.
The known exploit utilizes the deprecated --underlay option so another mitigation may be to set enable underlay = no in apptainer.conf.
Credit
gogi (@dmskhs0912), assisted by OpenAI Codex.