Repository navigation
Oss scanner 9 - #2344
Open
giuseppe wants to merge 3 commits into
Open
Oss scanner 9#2344giuseppe wants to merge 3 commits into
giuseppe wants to merge 3 commits into
Conversation
do_umount_in_a_container() called umount2() on the destination path in the container mount namespace, following any symlink created by the container, so a different mount could be detached. Walk to the parent directory with O_NOFOLLOW and unmount the last component with UMOUNT_NOFOLLOW. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-TH0HP1G4. Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
libcrun_make_runtime_mounts() created non-bind file systems from the crun process on the host, so they were bound to the host namespaces (e.g. an added proc showed the host processes) and the data options were dropped. Create them from a helper process that joins the container user, PID, net, IPC and cgroup namespaces, using open_mount_of_type() as for the mounts in the configuration. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-ZCEYY697. Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
run_in_container_namespace() joined with setns() whatever mount namespace the init of the container was in, so an init that called unshare(CLONE_NEWUSER|CLONE_NEWNS) received the mount created by `mounts add` in a namespace where it holds CAP_SYS_ADMIN and where the MNT_LOCK_* flags are not set, and could remount it without the ro, nosuid, nodev and noexec flags it was given. Open /proc/<pid>/ns/mnt, get its owning user namespace with NS_GET_USERNS, check it is the one the configuration describes, and join the same descriptor that was checked. `mounts remove` goes through the same function. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-IJ52D413. Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.