Fix slide might able to add unsafe attribute on section tag which cause XSS [Security Issue]
This commit is contained in:
5
public/js/reveal-markdown.js
Normal file → Executable file
5
public/js/reveal-markdown.js
Normal file → Executable file
@@ -286,7 +286,10 @@
|
||||
nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( mardownClassesInElementsRegex.lastIndex );
|
||||
node.nodeValue = nodeValue;
|
||||
while( matchesClass = mardownClassRegex.exec( classes ) ) {
|
||||
elementTarget.setAttribute( matchesClass[1], matchesClass[2] );
|
||||
var name = matchesClass[1];
|
||||
var value = matchesClass[2];
|
||||
if (name.substr(0, 5) === 'data-' || whiteListAttr.indexOf(name) !== -1)
|
||||
elementTarget.setAttribute( name, filterXSS.escapeAttrValue(value) );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user