-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
Description
While possible a bad example, the following will produce corrupted data in AST:
[url=javascript:alert('XSS ME');]TEXT[/url]
[url=javascript:alert("XSS ME");]TEXT[/url]
This can already be seen in the HTML Render demo, that outputs the (processed) AST tree as:
[
{"tag":"a","attrs":{"href":"ME');"},"content":["TEXT"]},
"\n",
{"tag":"a","attrs":{"href":");"},"content":["TEXT"]},"\n"
]
If debugging the parsed tree prior to processing, the first line is represented as:
[
{
"tag": "url",
"attrs": {
"javascript:alert('XSS": "javascript:alert('XSS",
"ME');": "ME');"
},
"content": [
"TEXT"
]
}
]
the second one as:
[
{
"tag": "url",
"attrs": {
"javascript:alert(\"XSS ME": "javascript:alert(\"XSS ME",
");": ");"
},
"content": [
"TEXT"
]
}
]
This is possible a similar issue to: #194.
While it may be argued, if the BBCode should not have used, for example, quotes for the first example (which works as expected):
[url="javascript:alert('XSS ME');"]TEXT[/url]
The pain point is, that typically BBCode origins from manually written markup. Thus, more fault-tolerance would be highly appreciated.
Alternative Challenges
[quote=J. D.]T[/quote]
[quote=J. "The T" D.]T[/quote]