From 4546653b5a0f347acbed3068f87cc1096279990d Mon Sep 17 00:00:00 2001 From: catborise Date: Fri, 2 Oct 2026 18:29:11 +0300 Subject: [PATCH] fix: serve JSON endpoints as application/json and build DOM safely Several views returned json.dumps() output through HttpResponse, i.e. as text/html, and guess_mac_address reflects the URL's vname into it (reflected XSS). Templates filled the log table and volume dropdowns by concatenating server data into HTML strings, and log messages contain user-entered snapshot/disk/clone names (stored XSS that runs when a superuser opens the Logs tab). - Use JsonResponse in guess_mac_address, random_mac_address, guess_clone_name, sshkeys, storages.get_volumes, datasource.os_metadata_json and logs.vm_logs; sshkeys?plain=true is served as text/plain. - stats_tab.html builds log rows with .text(); instance.html and create_instance_w2.html build '); + $("#image-control").append($("'); + $("#template").append($("'); + $("#bus" + dev_idx).append($("'); + $("#vols").append($("