Skip to content

Commit 457e1ff

Browse files
committed
tests: add regression test for CVE-2019-19921 / CVE-2023-27561
We reintroduced this once already because it is quite easy to miss this subtle aspect of proc mounting. The recent migration to securejoin.MkdirAllInRoot could have also inadvertently reintroduced this (though it didn't). Signed-off-by: Aleksa Sarai <[email protected]>
1 parent 7c2e69f commit 457e1ff

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/integration/mounts.bats

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ function test_mount_order() {
199199
[ "$status" -eq 0 ]
200200
}
201201

202+
# CVE-2023-27561 CVE-2019-19921
203+
@test "runc run [/proc is a symlink]" {
204+
# Make /proc in the container a symlink.
205+
rm -rf rootfs/proc
206+
mkdir -p rootfs/bad-proc
207+
ln -sf /bad-proc rootfs/proc
208+
# This should fail.
209+
runc run test_busybox
210+
[ "$status" -ne 0 ]
211+
[[ "$output" == *"must be mounted on ordinary directory"* ]]
212+
}
213+
202214
@test "runc run [ro /sys/fs/cgroup mounts]" {
203215
# Without cgroup namespace.
204216
update_config '.linux.namespaces -= [{"type": "cgroup"}]'

0 commit comments

Comments
 (0)