forked from nestybox/sysbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to verify Sysbox is not vulnerable to CVE 2024-21626.
Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bats | ||
|
||
# | ||
# Basic security checks | ||
# | ||
|
||
load ../helpers/run | ||
load ../helpers/docker | ||
load ../helpers/sysbox-health | ||
|
||
function teardown() { | ||
sysbox_log_check | ||
} | ||
|
||
@test "CVE-2024-21626 (runc leaked fds)" { | ||
# Verify this CVE does not affect Sysbox (i.e., the following command should | ||
# always fail, for all /proc/self/fd/<num>); with runc <= v1.1.11 (vulnerable | ||
# to CVE 2024-21626), one of these would most likely work and show the host's | ||
# "/" contents from within the container! | ||
for num in $(seq 1 20); do | ||
docker run --runtime=sysbox-runc -w /proc/self/fd/${num} ${CTR_IMG_REPO}/alpine:latest ls -l ../../.. | ||
[ "$status" -ne 0 ] | ||
done | ||
} |