From 32a285bede829db376329ab7ff45aa844892da31 Mon Sep 17 00:00:00 2001 From: retoor Date: Thu, 24 Jul 2025 01:53:22 +0200 Subject: [PATCH] Tests to remember. --- xsstest.js | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 xsstest.js diff --git a/xsstest.js b/xsstest.js new file mode 100644 index 0000000..90b680f --- /dev/null +++ b/xsstest.js @@ -0,0 +1,147 @@ +const xssTestVectors = [ + // Basic Script Injection + ``, + ``, + ``, + + // IMG Tag Attacks + ``, + ``, + ``, + ``, + + // SVG Attacks + ``, + ``, + ``, + + // Event Handler Attacks + ``, + `
Click me
`, + ``, + ``, + ``, + ``, + + // Link/Anchor Attacks + `Click`, + `Click`, + `Click`, + `Click`, + + // Style Attribute Attacks + `
`, + `
`, + ``, + + // Meta Tag Attacks + ``, + ``, + + // Form Attacks + `
`, + `
`, + + // Iframe Attacks + ``, + ``, + + // Object/Embed Attacks + ``, + ``, + + // Encoded Attacks + ``, + ``, + `Click`, + + // Data URI Attacks + `Click`, + ``, + + // Base64 Encoded + ``, + + // Protocol Handlers + `Click`, + `Click`, + + // Comments and CDATA + ``, + `alert('XSS')]]>`, + + // Malformed Tags + ``, + `ript>alert('XSS')ript>`, + `<`, + + // Case Variations + ``, + ``, + ``, + + // Null Bytes and Special Characters + ``, + `alert('XSS')`, + + // Multiple Vectors in One + `
Click
`, + + // CSS Expression (IE specific) + `
`, + + // HTML5 Specific + ``, + ``, + `
`, + + // Mutation XSS + `