From 8e05a2dd2ade3cac57350e0495c7e73444085e59 Mon Sep 17 00:00:00 2001
From: Alexandre ZANNI <16578570+noraj@users.noreply.github.com>
Date: Wed, 19 Jun 2024 14:54:19 +0200
Subject: [PATCH] XSS in SVG: more examples + nesting
---
XSS Injection/README.md | 62 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/XSS Injection/README.md b/XSS Injection/README.md
index a5a487e..f77f631 100644
--- a/XSS Injection/README.md
+++ b/XSS Injection/README.md
@@ -383,6 +383,8 @@ vbscript:msgbox("XSS")
### XSS in SVG
+Simple script. Codename: green triangle
+
```xml
@@ -395,6 +397,29 @@ vbscript:msgbox("XSS")
```
+More comprehensive payload with svg tag attribute, desc script, foreignObject script, foreignObject iframe, title script, animatetransform event and simple script. Codename: red lignthning. Author: noraj.
+
+```xml
+
+
+
+
+```
+
+
+
### XSS in SVG (short)
```javascript
@@ -405,6 +430,43 @@ vbscript:msgbox("XSS")
```
+### XSS in SVG (nesting)
+
+Including a remote SVG image in a SVG works but won't trigger the XSS embedded in the remote SVG. Author: noraj.
+
+SVG 1.x (xlink:href)
+
+```xml
+
+```
+
+Including a remote SVG fragment in a SVG works but won't trigger the XSS embedded in the remote SVG element because it's impossible to add vulnerable attribute on a polygon/rect/etc sicne the `style` attribute is no longer a vector on modern browsers. Author: noraj.
+
+SVG 1.x (xlink:href)
+
+```xml
+
+```
+
+However, including svg tags in SVG documents works and allows XSS execution from sub-SVGs. Codename: french flag. Author: noraj.
+
+```xml
+
+```
+
### XSS in Markdown
```csharp