5
0
mirror of git://git.proxmox.com/git/pve-http-server.git synced 2025-01-22 22:03:52 +03:00

html formatter: encode href attributes

these contain untrusted data, so treat them accordingly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2022-05-17 14:48:27 +02:00 committed by Thomas Lamprecht
parent 34f20af260
commit 6781735008

View File

@ -91,7 +91,7 @@ sub render_page {
text => 'Home'}};
foreach my $comp (@pcomp) {
$href .= "/$comp";
$href .= "/".encode_entities($comp);
push @$items, { tag => 'li', cn => {
tag => 'a',
href => $href,
@ -214,7 +214,7 @@ PVE::APIServer::Formatter::register_formatter($portal_format, sub {
push @$items, {
tag => 'a',
class => 'list-group-item',
href => "$path/$value",
href => "$path/".encode_entities($value),
cn => [
{
tag => 'h4',