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

Commit

Permalink
config: Add security warning on configuration examples
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
c3d committed Nov 10, 2020
1 parent 92065d8 commit fba4619
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
8 changes: 7 additions & 1 deletion cli/config/configuration-acrn.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ kernel = "@KERNELPATH_ACRN@"
image = "@IMAGEPATH@"

# List of valid annotations values for the hypervisor (default: empty)
# Each member of the list can be a regular expression
# 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.
# path_list = [ "@ACRNPATH@.*" ]

# List of valid annotations values for ctlpath (default: empty)
Expand Down
13 changes: 10 additions & 3 deletions cli/config/configuration-clh.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@

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

# List of valid annotations values for the hypervisor (default: empty)
# 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.
# path_list = [ "@CLHPATH@.*" ]

# Optional space-separated list of options to pass to the guest kernel.
# For example, use `kernel_params = "vsyscall=emulate"` if you are having
# trouble running pre-2.15 glibc.
Expand Down
8 changes: 7 additions & 1 deletion cli/config/configuration-fc.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ kernel = "@KERNELPATH_FC@"
image = "@IMAGEPATH@"

# List of valid annotations values for the hypervisor (default: empty)
# Each member of the list can be a regular expression
# 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.
# path_list = [ "@FCPATH@.*" ]

# Path for the jailer specific to firecracker
Expand Down
8 changes: 7 additions & 1 deletion cli/config/configuration-qemu-virtiofs.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ image = "@IMAGEPATH@"
machine_type = "@MACHINETYPE@"

# List of valid annotations values for the hypervisor (default: empty)
# Each member of the list can be a regular expression
# 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.
# path_list = [ "@QEMUPATH@.*" ]

# Optional space-separated list of options to pass to the guest kernel.
Expand Down
8 changes: 7 additions & 1 deletion cli/config/configuration-qemu.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
[hypervisor.qemu]
path = "@QEMUPATH@"
# List of valid annotations values for the hypervisor (default: empty)
# Each member of the list can be a regular expression
# 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.
# path_list = [ "@QEMUPATH@.*" ]
kernel = "@KERNELPATH@"
initrd = "@INITRDPATH@"
Expand Down

0 comments on commit fba4619

Please sign in to comment.