From 32d7f279e72432f4034477f8bf959e29fe6b2e48 Mon Sep 17 00:00:00 2001 From: catborise Date: Sat, 3 Oct 2026 00:00:27 +0300 Subject: [PATCH] test: inventory HTML sinks in templates, realistic datasource params in the matrix - instances/test_xss.py: scan all templates for .html(, innerHTML = and append('<...') and require each line to be in a reviewed allowlist, so new sinks fail the test (the exact-string tests only caught the lines they named). - Authorization matrix: fill the datasource "version" parameter with "latest" instead of "x". The datasource views then answer 200 to any logged-in user; they are listed in the allowlist as known F-14. --- instances/test_xss.py | 38 +++++++++++++++++++++++ webvirtcloud/test_authorization_matrix.py | 7 +++++ 2 files changed, 45 insertions(+) diff --git a/instances/test_xss.py b/instances/test_xss.py index b6867ca9..4e9d631d 100644 --- a/instances/test_xss.py +++ b/instances/test_xss.py @@ -3,6 +3,7 @@ Regression tests for ROADMAP Wave 0 item 3 (S-06, S-07): JSON endpoints must not be served as text/html (reflected XSS), and templates must not build HTML by concatenating server data that contains user-controlled names (stored XSS). """ +import re from pathlib import Path from unittest.mock import patch @@ -127,3 +128,40 @@ class TemplateHtmlConcatenationTestCase(TestCase): def test_create_wizard_volume_lists_do_not_concatenate_volume_names_into_html(self): src = self._read("instances/templates/create_instance_w2.html") self.assertNotIn("'