Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit dc97a64

Browse files
c3dfidencio
authored andcommitted
config: Add security warning on configuration examples
Add the following text explaining the risk of using regular expressions in path lists: Each member of the list can be a regular expression, but prefer names. Otherwise, please read and understand the following carefully. SECURITY WARNING: If you use regular expressions, be mindful that an attacker could craft an annotation that uses .. to escape the paths you gave. For example, if your regexp is /bin/qemu.* then if there is a directory named /bin/qemu.d/, then an attacker can pass an annotation containing /bin/qemu.d/../put-any-binary-name-here and attack your host. Fixes: #3004 Signed-off-by: Christophe de Dinechin <[email protected]>
1 parent 99ef2b6 commit dc97a64

File tree

5 files changed

+38
-7
lines changed

5 files changed

+38
-7
lines changed

cli/config/configuration-acrn.toml.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ kernel = "@KERNELPATH_ACRN@"
1717
image = "@IMAGEPATH@"
1818

1919
# List of valid annotations values for the hypervisor (default: empty)
20-
# Each member of the list can be a regular expression
20+
# Each member of the list can be a regular expression, but prefer names.
21+
# Otherwise, please read and understand the following carefully.
22+
# SECURITY WARNING: If you use regular expressions, be mindful that
23+
# an attacker could craft an annotation that uses .. to escape the paths
24+
# you gave. For example, if your regexp is /bin/qemu.* then if there is
25+
# a directory named /bin/qemu.d/, then an attacker can pass an annotation
26+
# containing /bin/qemu.d/../put-any-binary-name-here and attack your host.
2127
# path_list = [ "@ACRNPATH@.*" ]
2228

2329
# List of valid annotations values for ctlpath (default: empty)

cli/config/configuration-clh.toml.in

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@
1212

1313
[hypervisor.clh]
1414
path = "@CLHPATH@"
15-
# List of valid annotations values for the hypervisor (default: empty)
16-
# Each member of the list can be a regular expression
17-
# path_list = [ "@CLHPATH@.*" ]
1815
kernel = "@KERNELPATH_CLH@"
1916
image = "@IMAGEPATH@"
2017

18+
# List of valid annotations values for the hypervisor (default: empty)
19+
# Each member of the list can be a regular expression, but prefer names.
20+
# Otherwise, please read and understand the following carefully.
21+
# SECURITY WARNING: If you use regular expressions, be mindful that
22+
# an attacker could craft an annotation that uses .. to escape the paths
23+
# you gave. For example, if your regexp is /bin/qemu.* then if there is
24+
# a directory named /bin/qemu.d/, then an attacker can pass an annotation
25+
# containing /bin/qemu.d/../put-any-binary-name-here and attack your host.
26+
# path_list = [ "@CLHPATH@.*" ]
27+
2128
# Optional space-separated list of options to pass to the guest kernel.
2229
# For example, use `kernel_params = "vsyscall=emulate"` if you are having
2330
# trouble running pre-2.15 glibc.

cli/config/configuration-fc.toml.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ kernel = "@KERNELPATH_FC@"
1616
image = "@IMAGEPATH@"
1717

1818
# List of valid annotations values for the hypervisor (default: empty)
19-
# Each member of the list can be a regular expression
19+
# Each member of the list can be a regular expression, but prefer names.
20+
# Otherwise, please read and understand the following carefully.
21+
# SECURITY WARNING: If you use regular expressions, be mindful that
22+
# an attacker could craft an annotation that uses .. to escape the paths
23+
# you gave. For example, if your regexp is /bin/qemu.* then if there is
24+
# a directory named /bin/qemu.d/, then an attacker can pass an annotation
25+
# containing /bin/qemu.d/../put-any-binary-name-here and attack your host.
2026
# path_list = [ "@FCPATH@.*" ]
2127

2228
# Path for the jailer specific to firecracker

cli/config/configuration-qemu-virtiofs.toml.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ image = "@IMAGEPATH@"
1717
machine_type = "@MACHINETYPE@"
1818

1919
# List of valid annotations values for the hypervisor (default: empty)
20-
# Each member of the list can be a regular expression
20+
# Each member of the list can be a regular expression, but prefer names.
21+
# Otherwise, please read and understand the following carefully.
22+
# SECURITY WARNING: If you use regular expressions, be mindful that
23+
# an attacker could craft an annotation that uses .. to escape the paths
24+
# you gave. For example, if your regexp is /bin/qemu.* then if there is
25+
# a directory named /bin/qemu.d/, then an attacker can pass an annotation
26+
# containing /bin/qemu.d/../put-any-binary-name-here and attack your host.
2127
# path_list = [ "@QEMUPATH@.*" ]
2228

2329
# Optional space-separated list of options to pass to the guest kernel.

cli/config/configuration-qemu.toml.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
[hypervisor.qemu]
1414
path = "@QEMUPATH@"
1515
# List of valid annotations values for the hypervisor (default: empty)
16-
# Each member of the list can be a regular expression
16+
# Each member of the list can be a regular expression, but prefer names.
17+
# Otherwise, please read and understand the following carefully.
18+
# SECURITY WARNING: If you use regular expressions, be mindful that
19+
# an attacker could craft an annotation that uses .. to escape the paths
20+
# you gave. For example, if your regexp is /bin/qemu.* then if there is
21+
# a directory named /bin/qemu.d/, then an attacker can pass an annotation
22+
# containing /bin/qemu.d/../put-any-binary-name-here and attack your host.
1723
# path_list = [ "@QEMUPATH@.*" ]
1824
kernel = "@KERNELPATH@"
1925
initrd = "@INITRDPATH@"

0 commit comments

Comments
 (0)