From 81d766b2187ae6ce6a8d534f70b482a89de2455a Mon Sep 17 00:00:00 2001 From: quality Date: Sun, 11 Oct 2026 18:40:53 -0400 Subject: [PATCH] test: pin CONTENT-SECURITY.md's enumerated rules to the scanners that enforce them CONTENT-SECURITY.md is the submitter-facing contract for the two import gates, and it works by enumeration: these elements, these attributes, these URI schemes, these inert MDX tags. Every list is a copy of a constant in scripts/lib/svg-active-content.mjs, scripts/lib/uri-safety.mjs or scripts/lib/mdx-active-content.mjs, and nothing held the copy to the original. It had already drifted. ACTIVE_ELEMENTS gained base and meta in 5dad895, while the document was written earlier in 29fd4d8 and never revisited, so a submitter whose export carried a base element got a CI finding in vocabulary the document did not define. tests/content-security-contract.test.mjs checks each list in both directions and then runs every entry through the scanner it belongs to, so the test is pinned to behaviour rather than to a constant the scanner might have stopped consulting. CONTENT-SECURITY.md gains the two missing elements. Closes #1326 Signed-off-by: quality --- CONTENT-SECURITY.md | 4 +- tests/content-security-contract.test.mjs | 344 +++++++++++++++++++++++ 2 files changed, 347 insertions(+), 1 deletion(-) create mode 100644 tests/content-security-contract.test.mjs diff --git a/CONTENT-SECURITY.md b/CONTENT-SECURITY.md index 69afe535..a8c23d71 100644 --- a/CONTENT-SECURITY.md +++ b/CONTENT-SECURITY.md @@ -68,7 +68,9 @@ characters, and whitespace obfuscation, so re-spelling a construct does not help — remove it. - **Script-bearing or embedding elements**: `