diff --git a/Servers/WebServer/Client.cpp b/Servers/WebServer/Client.cpp index 4f81e7985b..c399abcac6 100644 --- a/Servers/WebServer/Client.cpp +++ b/Servers/WebServer/Client.cpp @@ -132,11 +132,11 @@ void Client::handle_directory_listing(const String& requested_path, const String builder.append("\n"); builder.append("\n"); builder.append("Index of "); - builder.append(requested_path); + builder.append(escape_html_entities(requested_path)); builder.append("\n"); builder.append("\n"); builder.append("

Index of "); - builder.append(requested_path); + builder.append(escape_html_entities(requested_path)); builder.append("

\n"); builder.append("
\n"); builder.append("
\n");
@@ -145,9 +145,10 @@ void Client::handle_directory_listing(const String& requested_path, const String
     while (dt.has_next()) {
         auto name = dt.next_path();
         builder.append("");
-        builder.append(name);
+        builder.append(escape_html_entities(name));
         builder.append("");
         for (size_t i = 0; i < (40 - name.length()); ++i)
             builder.append(' ');