web.CheckStyle(style : str) : str
Check contents of style attribute for possible XSS vulnerabilities.
Usage Restrictions
1.9.1 or later
Parameters
| Name | Type | Description |
| uri | str | style contents to check |
Result
The style name if there is no XSS vulnerability.
An error, if there is an XSS vulnerability ('url()', 'http://', or expressions in the style attribute).
Samples
| | Output |
| to check a style for XSS vulnerability: {{ web.checkstyle( '<a style=\"background-image:url(test.jpg)\" href=\"test\">HI</a>' ) }} | | style contains potential XSS vulnerability
Parameter name: style (click for details)Callstack:
at en/docs/DekiScript/Reference/DekiScript_Functions_and_Variables/Web.CheckStyle
at web.checkstyle
System.ArgumentException: style contains potential XSS vulnerability
Parameter name: style
at MindTouch.Deki.Script.Runtime.Library.DekiScriptLibrary.WebCheckStyle (System.String style) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 |
| to check a style for XSS vulnerability: {{ web.checkstyle( '<img src="image.jpg" style="border:1px solid black" alt="image_test"/>' ) }} | | <img src="image.jpg" style="border:1px solid black" alt="image_test"/> |