Apptainer has incorrect path matching for 'limit container paths' directive
Published 26 Jun 2026 · Updated 7 Jul 2026
Is your project on an affected github.com/apptainer/apptainer?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <1.5.1
- Fixed in
- 1.5.1
go get github.com/apptainer/apptainer@v1.5.1Details
Impact
The limit container paths directive in apptainer.conf is intended to allow a system administrator limit the paths from which containers can be run, under setuid mode. Due to incorrect matching of a path string, sibling directories with similar names may incorrectly be allowed.
For example, the configuration:
limit container paths = /data/safe
Will also allow containers in /data/safe-but-unsafe to be run.
Patches
The issue is patched in apptainer version 1.5.1.
Workarounds
If developers do not use setuid mode or do not use the limit container paths functionality, then this issue does not affect their installation. Note that, as documented [1], if user namespaces are allowed for unrestricted use then this functionality does not stop users from running any container of their choice.
If developers do use the limit container paths functionality they are advised to update.
Credit
This vulnerability was discovered and disclosed to the Apptainer project by Dave Trudgian of Sylabs.
Resources
[1] https://apptainer.org/docs/admin/latest/configfiles.html#limiting-container-execution
Is GHSA-cr2j-534f-mf3g in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/apptainer/apptainer, and gives you the command that fixes it.
More advisories for github.com/apptainer/apptainer
- LowCVE-2025-65105Apptainer ineffectively applies selinux and apparmor --security options in github.com/apptainer/apptainer · 8 Dec 2025
- MediumCVE-2025-65105Apptainer ineffectively applies selinux and apparmor --security options · 2 Dec 2025
- LowCVE-2023-38496Ineffective privileges drop when requesting container network in github.com/apptainer/apptainer · 20 Aug 2024
- LowCVE-2023-30549Unpatched extfs vulnerabilities are exploitable through suid-mode Apptainer in github.com/apptainer/apptainer · 20 Aug 2024
- MediumCVE-2023-38496Ineffective privileges drop when requesting container network · 25 Jul 2023
- HighCVE-2023-30549Unpatched extfs vulnerabilities are exploitable through suid-mode Apptainer · 25 Apr 2023
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.