From 0cb4d663f54896ba78a8374a9f201d461d0f2449 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 20 Sep 2015 10:34:04 +0200 Subject: [PATCH] SectionConfig: protect against newline injection --- src/PVE/SectionConfig.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index 71d296e..95e166a 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -393,6 +393,9 @@ my $format_config_line = sub { my $ct = $schema->{type}; + die "property '$key' contains a line feed\n" + if ($key =~ m/[\n\r]/) || ($value =~ m/[\n\r]/); + if ($ct eq 'boolean') { return $value ? "\t$key\n" : ''; } else { -- 2.39.2